I could not figure out from example how the new Chart 3.0 API works for valueFormatter. Below is previous version of snippet. Please advise.
let formatter = NumberFormatter()
formatter.numberStyle = .none
lineChartAltitude.leftAxis.valueFormatter = formatter
The new API does not inherit from the Cocoa's formatters. It passes more information about the value to be formatted, like the X value.
_But_ the formatters can take a number formatter - https://github.com/danielgindi/Charts/blob/master/Source/Charts/Formatters/DefaultAxisValueFormatter.swift#L56, https://github.com/danielgindi/Charts/blob/master/Source/Charts/Formatters/DefaultValueFormatter.swift#L56
You can read the migration notes - it tells exactly how to deal with it if you're not interested in the new formatter api :-)
For other benefit. Here are the examples.
@danielgindi Hope below example is right and I can see working now. Please advise.
Line Chart
let format = NumberFormatter()
format.numberStyle = .none
let formatter = DefaultValueFormatter(formatter: format)
lineChartSpeed.leftAxis.valueFormatter = (formatter as? IAxisValueFormatter)
Pie Chart
let format = NumberFormatter()
format.numberStyle = .none
let formatter = DefaultValueFormatter(formatter: format)
pieChartData.setValueFormatter(formatter)
Most helpful comment
For other benefit. Here are the examples.
@danielgindi Hope below example is right and I can see working now. Please advise.
Line Chart
Pie Chart