ChartView icon indicating copy to clipboard operation
ChartView copied to clipboard

valueSpecifier not working on MultiLineChartView

Open thomas-alrek opened this issue 5 years ago • 0 comments

I am unable to change the default valueSpecifier for the MultiLineChartView. It shows percentage no matter what I do.

Description

MultiLineChartView(
    data: [(device.voltageMeasurements, GradientColors.green)],
    title: "Voltage",
    form: ChartForm.extraLarge,
    valueSpecifier: "%.2f V"
)

Expected Behavior

I would expect the MultiLineChartView to show the value formatted with the provided valueSpecifier.

Actual Behavior

It shows the value with the default valueSpecifier.

image

Steps to Reproduce

class Device: ObservableObject {
    @Published var voltageMeasurements: [Double] = [41, 42, 42.5, 39.9, 41.2]
}

struct TestView: View {
    @ObservedObject var device = Device()

    var body: some View {
        MultiLineChartView(
            data: [(device.voltageMeasurements, GradientColors.green)],
            title: "Voltage",
            form: ChartForm.extraLarge,
            valueSpecifier: "%.2f V"
        )
    }
}

Your Environment

  • Version of this package used: 1.5.4
  • Device/Simulator: iPhone X
  • Operating System and version: iOS 14.0 (18A5342e)

thomas-alrek avatar Aug 21 '20 13:08 thomas-alrek