Dynamically adding points to the graph

161 views
Skip to first unread message

Massimiliano

unread,
Feb 4, 2010, 11:34:39 AM2/4/10
to Jzy3d
I am trying to display live data, every once in a while new points are
added to my scatter, (extends Drawable implements SingleColorable) and
I am firing a DrawableChanged event.
Now, I am guessing I should write a listener for that event somewhere,
but how do I trigger the repainting of the scene, chart, view or
whatever to have the whole thing be redrawn?

Thanks,
Massimiliano

Massimiliano

unread,
Feb 4, 2010, 11:56:42 AM2/4/10
to Jzy3d
I have just noticed that calling myChart.render() makes my scatter be
redrawn. However nothing is displayed.

I am initializing the scatter with an empty list of points, so there
are no axes and only the background is shown.
Then, every once in a while I add a bunch of points to the list of
points to be rendered, and to the bounding box, and I call the render
method on the chart, but nothing happens :(

Martin Pernollet

unread,
Feb 4, 2010, 12:18:55 PM2/4/10
to jz...@googlegroups.com


2010/2/4 Massimiliano <email...@gmail.com>

I am trying to display live data, every once in a while new points are
added to my scatter, (extends Drawable implements SingleColorable) and
I am firing a DrawableChanged event.

You may look at the Mikado demo that add and then removes Line objects from the scene graph while it is already displayed.
This demo was a way to show that Graph.add(Drawable) and Graph.remove(Drawable) indeed refresh the graph.
There is a Graph.remove(Drawable, boolean) method to avoid rendering if you have to remove plenty of object before redraw.
There is currently no equivalent Graph.add(Drawable, boolean)

I added the DrawableChangedEvent really long time ago, and am not using it anymore. I fear it's slowing down rendering most of the time, so I have to re-think about this feature.
 
Reply all
Reply to author
Forward
0 new messages