I am using iOS Charts
framework to show bar chart on my app.
My leftAxisFormatter
is like this
let leftAxisFormatter = NumberFormatter()
leftAxisFormatter.minimumFractionDigits = 0
leftAxisFormatter.maximumFractionDigits = 2
leftAxisFormatter.positivePrefix = "$"
My data set is like this
0 : ChartDataEntry, x: 0.0, y 0.0
1 : ChartDataEntry, x: 1.0, y 7.6
2 : ChartDataEntry, x: 2.0, y 0.0
3 : ChartDataEntry, x: 3.0, y 0.0
4 : ChartDataEntry, x: 4.0, y 48.07
5 : ChartDataEntry, x: 5.0, y 107.26
6 : ChartDataEntry, x: 6.0, y 0.0
I am showing value using BalloonMarker
When I tap a bar from chart but the value in marker always shows only one fraction digit, I have tried playing with NumberFormatter
but no luck.
Please refer below screen shot in which I want to show 2 fraction digits for value shown into Marker, here it should be 107.26 according to my dataset.
Please suggest me what am I doing wrong?
Thanks