iOS-Charts Float to Integer YAxis

后端 未结 5 635
没有蜡笔的小新
没有蜡笔的小新 2020-12-19 04:38

I\'m building a chart using iOS-charts \"IOS

I\'m trying to convert the floats into int, but iOS-charts

5条回答
  •  鱼传尺愫
    2020-12-19 05:15

    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. :-)

提交回复
热议问题