I am creating a small iPhone application using CorePlot. The graph consists of 10 bars. Unfortunately, the y-values might differ between 0 and 1 million, therefore I create my plotspace with a rather huge yRange
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(yAxisStart)
length:CPTDecimalFromDouble(yAxisLength)];
What I am experiencing is that my application is really slow when loading the graph, and I can pinpoint this issue to the rather large value of yAxisLength. I already removed the creation of tickmarks on the y axis, but still the performance is very bad. Can anyone give me a hint how to improve performance?
Make sure you update the labeling parameters, even if you don’t need any labels or ticks. The default labeling policy creates tick marks and labels one unit apart. That’s why a large axis range slows your app down so much. It also creates a separate Core Animation layer for each label. Creating 1 million labels will take a long time and use a lot of memory.
If you don’t need any ticks or labels, set the labeling policy to
CPTAxisLabelingPolicyNone. Otherwise, make the necessary adjustments to the various labeling properties (which ones to use depends on which policy you choose) so that there are reasonable number of ticks within the axis range.