I'm building a chart using iOS-charts
I'm trying to convert the floats into int, but iOS-charts only allows for Floats in the data entry:
let result = ChartDataEntry(value: Float(month), xIndex: i)
Does anyone know the method for making sure only ints are used?
You just need to adjust the NSNumberFormatter
...
Example:
yAxis.valueFormatter = NSNumberFormatter()
yAxis.valueFormatter.minimumFractionDigits = 0
NSNumberFormatter
is a very powerful class, you can do much much more with it. :-)