willdale / SwiftUICharts

A charts / plotting library for SwiftUI. Works on macOS, iOS, watchOS, and tvOS and has accessibility features built in.
MIT License
837 stars 103 forks source link

y-axis labels only integers #219

Closed mvolkmann closed 2 years ago

mvolkmann commented 2 years ago

I am displaying a line chart where values are all 0, 1, 2, 3, or 4. SwiftUICharts wants to display the following y-axis labels when I set maximumFractionDigits in the formatter to 1: 0, 0.7, 1.3, 2, 2.7, 3.3, and 4. Is there a way I can tell it only use the y-axis labels 0, 1, 2, 3, and 4?

mvolkmann commented 2 years ago

If I see maximumFractionDigits to zero, I get the y-axis labels 0, 1, 1, 2, 3, 3, and 4.

mvolkmann commented 2 years ago

The solution mentioned in this issue worked for me: https://github.com/willdale/SwiftUICharts/issues/40