1
votes

I have a graph with two plots. The first plot, CPTScatterPlot *boundLinePlot, is very data intensive and only has to be created once.

The second plot, CPTScatterPlot *dotPlot, on the other hand, is only a single point that moves across the graph in response to changes in a slider. I only have to refresh this plot.

I have been using [graph reloadData] at the end of my slider method, but that must refresh both plots and performance suffers greatly. What is the syntax for reloading just one plot?

Also, might it be possible to refresh only when the slider stops moving rather than refresh for every value of the slider between starting and stopping?

2

2 Answers

2
votes

You can call -reloadData on individual plots, too.

[dotPlot reloadData];
1
votes

You ask:

Also, might it be possible to refresh only when the slider stops moving rather than refresh for every value of the slider between starting and stopping?

This can easily be achieved by unsetting the 'Continuous' flag in the state part of the slider. Look in the xib or set it dynamically in your code:

Mac:

[yourSlider setContinuous:NO];

iOS:

yourSlider.continuous=NO;