JFreeChart support for animated charts

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
archana_pawar
Posts: 1
Joined: Fri Apr 13, 2007 9:17 am

JFreeChart support for animated charts

Post by archana_pawar » Fri Apr 13, 2007 9:22 am

Is it possible to generate animated charts using JFreeChart?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Apr 13, 2007 9:43 am

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

lucky7456969
Posts: 15
Joined: Thu Nov 01, 2012 6:41 am
antibot: No, of course not.

Re:

Post by lucky7456969 » Mon Aug 12, 2013 11:36 am

david.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)).
How do we get a fly-in simulation by portions of the chart? like powerpoint
Thanks
Jack

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: JFreeChart support for animated charts

Post by John Matthews » Mon Aug 12, 2013 4:45 pm

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.

lucky7456969
Posts: 15
Joined: Thu Nov 01, 2012 6:41 am
antibot: No, of course not.

Re: JFreeChart support for animated charts

Post by lucky7456969 » Wed Aug 14, 2013 12:16 am

I changed to

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 ) {
                     
               }
            }
         }            
       });
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

Locked