iPhone Development: Core-Plot performance Slow when handling a huge data

纵饮孤独 提交于 2019-12-01 01:22:00
  1. Be aware of the size of the plot area. If you have more data points than pixels, filter the data set as @benzado suggested.

  2. Use graphical elements that are fast to draw--opaque colors, no gradients, no images, no shadows. If the bars are only going to be a few pixels wide, don't set both the fill and border line; use whichever one draws faster.

  3. Reduce or eliminate extraneous elements like minor tick marks and grid lines.

  4. Use one of the datasource methods that provide a group of points in one call rather than one at a time.

    -(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
    -(double *)doublesForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
    -(CPTNumericData *)dataForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange;
    

Plot a sample of your data! Don't plot all 500 data points if you don't actually need to draw them all.

We did some speed comparisons of iOS Charts and one of them was Core-plot. Unfortunately Core-plot was so slow it could not do the first test!!

There were other chart components which were able to handle big data much more efficiently.

The test results and test setup are here: https://www.scichart.com/ios-chart-performance-comparison

In table format the results of a comparison between four main chart iOS providers can be found here.

Disclosure, I am the tech lead of the SciChart project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!