divyavamsee / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Dispatch NSNotification for rendering/animation of graph creation complete. #402

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to know when the entire graph has finished rendering (axis, plot, 
etc). 

Original issue reported on code.google.com by caspe...@gmail.com on 14 Feb 2012 at 10:52

GoogleCodeExporter commented 9 years ago
I don't think this is possible for rendering. Core Animation is responsible for 
scheduling the rendering of all graph elements. They can be done in any order 
and updated at any time the system determines it to be necessary. You can use a 
standard CAAnimation delegate to receive notification that an animation has 
finished.

Can you describe a use case for this feature? Depending on what you're trying 
to do, there may be an alternative that would achieve the desired goal.

Original comment by eskr...@mac.com on 15 Feb 2012 at 1:52

GoogleCodeExporter commented 9 years ago
In the provided CPTTestApp-iPhone.xcodeproj, the CPTTestAppBarChartController 
constructs the chart and its layers/elements inside the timerFired function 
(borders/stylings/axis'/etc). I want to do some processing after I know the 
graph has successfully created/rendered/laid out the layers/elements. If the 
graph elements can be observed by a CAAnimation delegate, how would I set that 
up to determine that the plot space ranges, plot, x and y axis have animated 
and finished. 

Original comment by caspe...@gmail.com on 15 Feb 2012 at 4:14

GoogleCodeExporter commented 9 years ago
You can call -layoutIfNeeded on the graph to force it to update its layout. 
When that method returns, all of the layers will be sized correctly and in 
their proper places. You can check the layer properties after the layout and 
use that information to position additional elements on screen. Core Animation 
will take care of drawing everything at the proper time.

The animation delegate would only be useful if you applied your own animation 
some part of the graph. The iPhone and iPad versions of CPTTestApp demonstrate 
that.

Original comment by eskr...@mac.com on 16 Feb 2012 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 21 Mar 2012 at 11:18