I’m using a rather small data set (less than 50 points) and wherever possible, I want users to experience 60 fps horizontal panning in the graphs. Unfortunately, even on an iPhone 5S, i’m unable to do so. Full disclosure though, i am panning multiple charts at the same time.
The first simple switch I made was changing how I provided data to the charts SDK. That is instead of using this on-demand provisioning of data to the graph:
- (id<SChartData>)sChart:(ShinobiChart *)theChart dataPointAtIndex:(NSInteger)dataIndex forSeriesAtIndex:(NSInteger)seriesIndex
give all the data up front by using this:
- (NSArray *)sChart:(ShinobiChart*)theChart dataPointsForSeriesAtIndex:(NSInteger)seriesIndex
but I saw basically no change in the frame rate. To keep a long story short, the way I was able to get it pegged at 60 on an iPhone 5S was to comment out all label formatters for X, Y axis. I noticed that if even if I hard coded the results of my label formatters,
-(NSString *)stringForObjectValue:(id)obj onAxis:(SChartAxis *)axis
returning @“h” for all objects, the performance really no different than when my proper formatting code was in play. That is, it still dropped 5 fps. That surprised me - does that seem right to you guys?
I’m guessing you provided the ability to provide all data up front for those of us that are sensitive to pan/zoom performance (and have relatively small data sets). If that’s true, could i also request that something similar be done for label formatting?
Any other suggestions/tips on how to squeeze the most FPS out of the graphs?