Closed GoogleCodeExporter closed 9 years ago
I modified achartengine to be able to dynamically add points. It is very
unmanageable, since it is basically a fork of the library from a year ago.
So, no, there's no way to do what you ask without modifying achartengine.
To the dev: this would be an awesome feature, but obviously requires a
re-engineering part of the way the engine works.
Original comment by jondwil...@gmail.com
on 19 Aug 2011 at 5:40
Add new data to the dataset and call view.repaint();
Original comment by dandrome...@gmail.com
on 23 Aug 2011 at 12:21
The only problem with calling view.repaint() is that it calls the view's
invalidate() function and forces a redraw of the entire view, not just the
internal graphing element. This is VERY costly in terms of memory overhead and
causes the garbage collector to go crazy. Each time the garbage collector runs,
it may take up to several hundred milliseconds. Thus, AChartEngine in its
current state can not be effectively used for realtime graphing.
To the dev: is there a way to add a method that will only redraw the
graphing/charting element to reduce memory cost and avoid garbage collection?
Original comment by pr...@control-tec.com
on 1 Jul 2013 at 7:58
There is another version of the repaint method that allows you to only
invalidate a certain part of the screen: repaint(int left, int top, int right,
int bottom);
Original comment by 4viewsoft@gmail.com
on 19 Jul 2013 at 2:30
Can somebody give any little example of usage repaint(int left, int top, int
right, int bottom); ?
Can't get it working.
I'm trying to draw real-time graph (ECG), and it goes slow after a few hundred
of points with repaint().
Now, after loading new part of ecg-data from sensor I calculate minimum and
maximum X-value of new points. Then I convert (minX, maxX) in GraphicalView
coordinates (left, right) using appropriate scale factor. Then I call
repaint(max(0,left-5), 0, min(width,right+5), height); and it is not working.
After inspecting source code of GraphicalView and XYChart I conclude that this
is because repaint(left, top, right, bottom) method simply draws ENTIRE dataset
in appropriate region of GraphicalView instead of drawing only A PART of
dataset which is within region. Then I tried to change renderer's XAxisMax and
XAxisMin before calling repaint(left, top, right, bottom) with calculated
bounds of new data points, and again have no success...
Original comment by konel...@gmail.com
on 9 Mar 2014 at 9:30
Original issue reported on code.google.com by
alkon...@gmail.com
on 18 Aug 2011 at 2:54