3
votes

I am trying to animate the "drawing" of new data using a CPTScatterPlot objects.

I am now looking at the RealTime example that you can find here in the examples subdirectory. It is one of the example of the CorePlotGallery. Make sure you use the iOS one.

This RealTime plot is pretty simple: it injects some random data in the graph every second. What I am trying to accomplish is to animate the drawing of the line so that it seems that the line is being drawn realtime.

If you take a close look at the example, you will notice that "segments" appear in the chart as soon as new data is inserted into it. How can I animate the "creation" of those segments?

Thank you

1

1 Answers

0
votes

Until this is added natively to Core Plot (see this outstanding issue), use a timer to animate the line. Each time the timer fires, use the -reloadDataInIndexRange: method to update the last point on the line, moving it closer to the final value each time.