Dynamic chart sample code

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Vicky

Dynamic chart sample code

Post by Vicky » Mon Mar 25, 2002 12:32 am

Hi, everybody.

I've just started working with charts, and I was wondering if any of you have sample code for a simple dynamic chart, where you supply the y value every n seconds and the chart gets updated (something like a Task Manager for windows).

I've looked and the code for the demo dynamic chart, and followed it's example. However, I only get the dotted lines in the intersection of the generated values, but the graph itself is not drawn.

Please help.
Thank you,
-Vicky

David Gilbert

Re: Dynamic chart sample code

Post by David Gilbert » Thu Mar 28, 2002 6:39 pm

Hi Vicky,

I've written a small sample application to show dynamic data updates - it has a single time series, and every time you click a button it adds a random value to the time series and updates the chart.

The code relies on some changes I have made to the core classes, including a bug fix to the Millisecond class and some changes to the TimeSeriesCollection class...so I won't post it now, but it will be included with version 0.8.1 (hopefully out during next week).

Regards,

Dave Gilbert

Jim Buchman

Re: Dynamic chart sample code

Post by Jim Buchman » Thu Apr 04, 2002 9:38 pm

Hi,
How is the performance of FreeChart for frequently updating data? We did a sample application recently using the Chart2D library to poll a router every 10 seconds and chart its results on screen. Just wanted to add a point to the right side of the chart every 10 seconds, similar to what Vicky is trying. The chart looked great, but the performance was awful. Does FreeChart handle dynamic data better?

Thanks,
Jim

David Gilbert

Re: Dynamic chart sample code

Post by David Gilbert » Thu Apr 04, 2002 11:32 pm

Jim Buchman wrote:
> Does FreeChart handle dynamic data better?

I can't make any comparisons since I've not tried out Chart2D yet. But if you are updating your chart only once every ten seconds then I don't think you will encounter any performance problems with JFreeChart.

Version 0.8.1 is getting close, and will include the demo I mentioned previously...

Regards,

DG.

David Gilbert

Re: Dynamic chart sample code

Post by David Gilbert » Mon Apr 08, 2002 9:25 am

Now that version 0.8.1 is released, you can try out the demo:

com.jrefinery.chart.demo.DynamicDataDemo

Regards,

DG.

Reji Mani

Re: Dynamic chart sample code

Post by Reji Mani » Mon Apr 08, 2002 11:50 am

Hi,

I am using JFreeChart for plotting dynamic TimeSeries charts (maximum 4 charts in a screen) with minimum refresh interval 1 second. No performance problem so far.

regards,

Reji Mani

David Gilbert

Re: Dynamic chart sample code

Post by David Gilbert » Mon Apr 08, 2002 12:06 pm

Reji Mani wrote:
> I am using JFreeChart for plotting dynamic TimeSeries charts
> (maximum 4 charts in a screen) with minimum refresh interval
> 1 second. No performance problem so far.

Great! Thanks for the feedback...

DG.

Locked