* Add PieChart interaction PR changes to v2 * Add custom string format for ChartLabel when interactionInProgress = true (#151) * Dark/Light mode fixes (#148) Fix for making text work with both Dark/Light mode. Also solves line chart background to appear white in dark mode * Add custom string format for ChartLabel when interactionInProgress = true Co-authored-by: Sagar Patel <s.72427patel@gmail.com> * Prepare charts to display x and y values souch as a value for a given point Co-authored-by: Roddy Munro <roddymunro@icloud.com> Co-authored-by: Sagar Patel <s.72427patel@gmail.com>
25 lines
716 B
Swift
25 lines
716 B
Swift
import SwiftUI
|
|
|
|
/// A dot representing a single data point as user moves finger over line in `LineChart`
|
|
struct IndicatorPoint: View {
|
|
/// The content and behavior of the `IndicatorPoint`.
|
|
///
|
|
/// A filled circle with a thick white outline and a shadow
|
|
public var body: some View {
|
|
ZStack {
|
|
Circle()
|
|
.fill(ChartColors.indicatorKnob)
|
|
Circle()
|
|
.stroke(Color.white, style: StrokeStyle(lineWidth: 4))
|
|
}
|
|
.frame(width: 14, height: 14)
|
|
.shadow(color: ChartColors.legendColor, radius: 6, x: 0, y: 6)
|
|
}
|
|
}
|
|
|
|
struct IndicatorPoint_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
IndicatorPoint()
|
|
}
|
|
}
|