Has anyone come up w/ a good strategy for animating the charts?
Seems like the in thing in the flash charts is the animated growing of the bars when they plot.
I prototyped extending my dataset, adding a scaler setting and the getYValue returns a scaled value. dataset.setScaler, calls fireDatasetChanged().
When the chart is created, I kickoff a background thread to progressively set the scaler, until getYValue is returning unscaled values.
It works, but it's not synchronized with the drawing of the chart, so if the background thread sets the scaler too fast, it's as if the DatasetChangedEvents are all bundled up and you only see the final draw with full values.
This seems like a hokey approach, I was wondering if anyone had ever done anything more cleanly to animate the drawing of the chart?
thanks,
andrew
Animated charts
Did you try calling
and getting the background thread to wait for a notification that the repaint has completed? Or get rid of the background thread and use the listener to advance to the next "frame".
Code: Select all
jFreeChart.addProgressListener(ChartProgressListener listener)
-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
I'm using a combinedRangeXYPlot, using XYDifference render, which does 2 drawing passes and a bunch of datasets, so a redraw is not a minor event:-)
Can I separate out the plots make them transparent and layer them on top of one another, the redraw the layers? Except making transparent, may cause the whole thing to repaint, each time anyway?
Can I separate out the plots make them transparent and layer them on top of one another, the redraw the layers? Except making transparent, may cause the whole thing to repaint, each time anyway?