piaoyongren / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Bar plot bars lagging on scroll #169

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a horizontally scrollable bar graph
2. Have plotSpace:willChangePlotRangeTo:forCoordinate: function call [graph 
reloadData]
3. Run the app, scroll the graph

What is the expected output? What do you see instead?
I expect to see the bars moving with the graph as I scroll. Instead the bars 
lag as I scroll and then jump to their record index when I stop scrolling.

What version of the product are you using? On what operating system?
Most current version. Mac OS X.

Please provide any additional information below.
I'm thinking there might just be too much going on for the update on the graph 
to be smooth. Is there any way I could consolidate calculations in 
numberForPlot? Or perhaps using threading? Thanks!

Original issue reported on code.google.com by HMUnderw...@gmail.com on 7 Jul 2010 at 8:32

GoogleCodeExporter commented 8 years ago
The plotSpace:willChangePlotRangeTo:forCoordinate: method is called many times 
during scrolling. Why do you need to reload data at that point? Core Plot can 
handle offscreen data.

Better to only reload data when the data actually changed. Without knowing 
exactly what you are plotting, I can't really tell you where that should be.

Original comment by drewmcco...@mac.com on 8 Jul 2010 at 7:02

GoogleCodeExporter commented 8 years ago
Hey Drew,

Thanks so much. I think I had some serious "end of the day" syndrome when I 
posted that issue. Basically I was trying to create a plot that had 14 records 
because there were 14 visible columns in the graph. However, my plot actually 
has many more records that are not in the visible area and I was under the 
impression I had to keep creating new plots for the visual area as it scrolled 
(thus the reload data in the plotSpace:willChangePlotRangeTo:forCoordinate: 
method). 

This morning after a cup of coffee it finally clicked and I created [datasource 
count] records from the plot and just reload the data on "view will appear". I 
guess an even more efficient way would be to set a flag when data has changed 
so it doesn't reload on every view will appear. 

Anyway, thanks again for getting back to me so quick. Next time I'll have that 
cup of coffee before I submit an issue! :)

-Heather

Original comment by HMUnderw...@gmail.com on 8 Jul 2010 at 5:37