2

So I am implementing a bar graph with core plots and currently have my y axis like this

enter image description here

What I'm trying to do is remove the trailing .0 from all the instances and am not sure what property I need to set, what method I need to override or what class I need to subclass to edit the display styling.

Thanks a lot for anyone who can help.

JLoewy
  • 535
  • 1
  • 4
  • 17

1 Answers1

2

Try to set the labelformatter with a suitable NSNumberFormatter.

For eg:-

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[numberFormatter setMaximumFractionDigits:0];
[numberFormatter setMinimumFractionDigits:0];
CPTXYAxis *y = axisSet.yAxis;
y.labelFormatter = numberFormatter;
iDev
  • 23,310
  • 7
  • 60
  • 85