yunjianwu / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Pinch-zooming is very cpu intensive, lagging when many datapoints. #267

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create XY Linechart with many points (> 10.000)
2. Pinch-zoom on the chart
3.

What is the expected output? What do you see instead?
Expected: Smooth zooming.
Experienced: Very slow/chopiness. Almost complete hang / ANR.

Please provide a source code snippet that we can use to replicate the issue.

What version of the product binary library are you using?
Version 1.0.0

Please provide any additional information below.
This must be due to the chart being redrawn every xx unit of pinch. Maybe this 
could be changed somehow? Or maybe store chart as image, zoom this, then redraw 
"real chart"?

Original issue reported on code.google.com by erikn...@gmail.com on 24 Jan 2013 at 10:41

GoogleCodeExporter commented 9 years ago
Please try the 1.1.0 nightly build and let me know if you see improvements.
You can download it here: 
https://repository-achartengine.forge.cloudbees.com/snapshot/org/achartengine/ac
hartengine/1.1.0/

Original comment by dandrome...@gmail.com on 25 Jan 2013 at 11:01

GoogleCodeExporter commented 9 years ago
Unsure, but there may be slight improvements. Still nowhere near smooth. 
It's decent with <1000 points, but degrades quickly above this (probably 
device-depentent as well). Over 5000 points is very choppy.

Original comment by erikn...@gmail.com on 25 Jan 2013 at 2:08

GoogleCodeExporter commented 9 years ago
How does a chart with 5000 points display on an Android device?

Original comment by dandrome...@gmail.com on 25 Jan 2013 at 2:13

GoogleCodeExporter commented 9 years ago
The chart displays very nice on a 10" tablet. If what you mean is that I could 
probably remove some points without loosing essiential stuff from the chart 
then yes, I guess that is an option.
But then maybe this should be built into the library somehow, making it a 
setting, ie:
nPointsToDisplay = some value.

Original comment by erikn...@gmail.com on 25 Jan 2013 at 2:26

GoogleCodeExporter commented 9 years ago
AChartEngine is a charting library. It is not a math library or a profiling 
tool for decimating data using a fancy algorithm for getting to perfect 
behavior.

Original comment by dandrome...@gmail.com on 25 Jan 2013 at 2:38

GoogleCodeExporter commented 9 years ago
Have you tried with antialiasing off?
renderer.setAntialiasing(false);

It should be at least 5 times faster.

Original comment by dandrome...@gmail.com on 1 Feb 2013 at 4:56

GoogleCodeExporter commented 9 years ago
Please try the new version once again and let me know if it improves things:
https://repository-achartengine.forge.cloudbees.com/snapshot/

Original comment by dandrome...@gmail.com on 2 Feb 2013 at 8:00

GoogleCodeExporter commented 9 years ago
Antialiasing off helps with performance, but is not worth it for me due to the 
reduced visual quality.
Don't know if I notice muhc of change between the different builds.

Original comment by erikn...@gmail.com on 4 Feb 2013 at 11:44

GoogleCodeExporter commented 9 years ago
I tried it with 1000 data points on the screen and I don't understand anything 
from that chart.

Original comment by dandrome...@gmail.com on 4 Feb 2013 at 12:19

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 7 Feb 2013 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 7 Feb 2013 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 7 Feb 2013 at 7:09

GoogleCodeExporter commented 9 years ago
I'm having the same issue. I have a TimeSeries with XYMultipleSeriesRenderer 
with over 11k points. Zooming and panning are extremely slow. Because this is 
run in a separate thread I do not get an ANR but there's at least several 
seconds of lag. 

If anybody has any suggestions for workarounds I'd appreciate it.

What I was thinking about doing was zoom the chart as a bitmap and update the 
axis after the fact.

Original comment by luis.fe...@gmail.com on 19 Feb 2013 at 9:08

GoogleCodeExporter commented 9 years ago
Here's the plot data I used.

Original comment by luis.fe...@gmail.com on 19 Feb 2013 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
I tried the recommendations in StackOverflow 
(http://stackoverflow.com/a/14773884/1172181) and saw a major improvement in 
performance.

Thanks!

Original comment by luis.fe...@gmail.com on 20 Feb 2013 at 6:46