How to access CALayer of individual bar in core-plot?

强颜欢笑 提交于 2019-12-11 13:31:22

问题


I am trying to perform an animation on each bar in the chart, however I am not quite sure how to access the calayer of each individual bar.


回答1:


There isn't one. All of the bars are drawn in one layer. If you need to animate them individually, make a separate CPTBarPlot (a subclass of CALayer) for each bar.




回答2:


I have another approach to this considering any performance issues you may face in future if your bars increases. You have a temporary CPTBarPlot with only one bar, to be used just for animation purpose. Use it to perform any animation and remove/hide it once you are done with animation.



来源:https://stackoverflow.com/questions/8874948/how-to-access-calayer-of-individual-bar-in-core-plot

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