Core Plot IPad performance issue

£可爱£侵袭症+ 提交于 2020-01-05 04:30:38

问题


In my app, i got core plot bar chart on a scroll view with paging, on IPhone all work fine , you page between different pages, one of them is the plot with its own touch gestures and properties. Problem starts when i run the same code on IPad. plot becomes slow and laggy, all touch gestures takes a lot of time to response and the whole scroller paging becomes heavy and slow. the chart itself contains 100 points or so (not so big). I've read somewhere that the change of plot space between IPhone and IPad makes these changes in performance because the IPad renders 4 times the graphics. Did anybody had this problem before? Is there something i can do to make performance better on IPad without limit or lose preform data?


回答1:


Without knowing the specifics of your app, here are some general performance hints:

  1. Set all line styles and fills that you don't need to nil rather than transparent colors.

  2. Use solid color fills rather than gradients or images where possible.

  3. Reduce the number of axis labels, tick marks, and grid lines if possible. Perhaps eliminate minor tick marks and grid lines completely (set the corresponding line styles to nil).

  4. Only call -reloadData when a significant portion of the plot data changes. Use the insert and delete methods when possible. See the "Real Time Plot" in the Plot Gallery example app.




回答2:


Unfortunately Core plot is a very slow library which can only handle a few hundred data-points (or less in some cases).

I wrote an answer here which describes a performance comparison between iOS chart components. One of the charts tested was core-plot and it couldn't do the first test!



来源:https://stackoverflow.com/questions/18713445/core-plot-ipad-performance-issue

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