I’m using CorePlot and I’m trying to use my number formatter, but the labels on the axes are clearly not using my formatter. This is the code I’m using:
CPTXYGraph *xygraph = [[CPTXYGraph alloc] initWithFrame:fullFrame];
self.graph = xygraph;
self.graph.title = @"Plot of Statistical Data Points";
self.graph.titleDisplacement = CGPointMake(0, -10);
hostingView.hostedGraph = self.graph;
CPTAxisSet *axisSet = xygraph.axisSet;
for (CPTAxis *axis in axisSet.axes) {
NSLog(@"setting axis (%@) label formatter=%@ -> %@", axis, axis.labelFormatter, self.formatter.completedValueFormatter);
axis.labelFormatter = self.formatter.completedValueFormatter;
}
I have verified that self.formatter.completedValueFormatter is a good NSNumberFormatter, but the labels on the axes are not using my formatter. What am I doing wrong?
I tested your code in the Plot Gallery example app and changing the label formatter seems to work correctly in the latest code.