核心图-对CPScatterPlot进行动画处理 [英] Core-Plot - animating a CPScatterPlot

查看:82
本文介绍了核心图-对CPScatterPlot进行动画处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发iPhone应用程序,在其中我使用Core-Plot框架显示图形。该图由CPScatterPlot组成,我想做的是使该图在屏幕上的显示具有动画效果。

I'm developing an iPhone application, in which I display a graph using Core-Plot framework. The graph is made of a CPScatterPlot, and what I'm trying to do is to animate the appearance of this plot on the screen.

我不是在寻找一个淡入动画,或者从屏幕左侧滑动绘图。我希望用户看到图表的每个点一次出现一个(从左侧开始),这样看来该图表正在被缓慢跟踪。

I'm not looking for a fade-in animation, or for the plot to be slid from the left of the screen. I'd rather like the user to see each point of the graph appearing one at a time (starting from the left), so that it would seem the graph is being traced slowly.

我怀疑Core-Plot提供了一种减慢图形跟踪的方法,因此我可能必须完全从头开始实现。有人知道我该怎么做吗?

I doubt Core-Plot provides a way to "slow down" the tracing of a graph, so I will probably have to implement this entirely from scratch. Does anyone have a clue on how I could do that ?

谢谢

推荐答案

我还没有尝试过,但是我将使用的方法是使用两个单独的散点图,这些散点图使用相同的外观属性(线条样式,绘图符号等)进行配置。将一个隐藏起来,然后将第一个点加载到另一个点。在隐藏的图中加载前两个点,并使用Core Animation使其淡入。动画结束时,隐藏第一个图,在其中加载前三个数据点,然后使其淡入。重复此交替的模式,直到所有数据点已加载。

I haven't tried it, but the approach I would use is to use two separate scatterplots that are configured using the same appearance properties (line style, plot symbols, etc.). Make one hidden and load the first point in the other one. Load the first two points in the hidden plot and use Core Animation to make it fade in. When the animation finishes, hide the first plot, load the first three data points in it, and fade it in. Repeat this alternating pattern until all of the data points have been loaded.

这篇关于核心图-对CPScatterPlot进行动画处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆