JFreeChart support for animated charts
-
- Posts: 1
- Joined: Fri Apr 13, 2007 9:17 am
JFreeChart support for animated charts
Is it possible to generate animated charts using JFreeChart?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes, subject to one proviso. Every time you update a dataset belonging to a chart, it triggers a sequence of events that results in the ChartPanel being repainted. If you update the dataset frequently (5 times per second, say) the chart will appear to be "animated". The proviso is that each update causes a complete redraw of the chart (not just the part that has changed), so the performance may or may not be acceptable (there are lots of variables, so you should test your own scenario(s)).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 15
- Joined: Thu Nov 01, 2012 6:41 am
- antibot: No, of course not.
Re:
How do we get a fly-in simulation by portions of the chart? like powerpointdavid.gilbert wrote:Yes, subject to one proviso. Every time you update a dataset belonging to a chart, it triggers a sequence of events that results in the ChartPanel being repainted. If you update the dataset frequently (5 times per second, say) the chart will appear to be "animated". The proviso is that each update causes a complete redraw of the chart (not just the part that has changed), so the performance may or may not be acceptable (there are lots of variables, so you should test your own scenario(s)).
Thanks
Jack
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: JFreeChart support for animated charts
I use javax.swing.Timer to animate a dataset, but I've never tried to go over 10 Hz. I'm guessing one of the Annotations would work for a fly-in. This example, running at 20 Hz, uses a damped spring model to mimic deceleration.
-
- Posts: 15
- Joined: Thu Nov 01, 2012 6:41 am
- antibot: No, of course not.
Re: JFreeChart support for animated charts
I changed to
Which properties control the x,y corners coordinates of the sectors? So is the annotations stuff, how do I control it?
Is there pie chart version of this?
http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=24570
Thanks
Jack
Code: Select all
chart.addProgressListener(new ChartProgressListener() {
private boolean animate = true;
public void chartProgress(final ChartProgressEvent event) {
if (event.getType() == ChartProgressEvent.DRAWING_FINISHED ) {
//System.out.println("Event working");
if ( animate ) {
}
}
}
});
Is there pie chart version of this?
http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=24570
Thanks
Jack