DynamicDataDemo

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

DynamicDataDemo

Post by gaurav kathotia » Mon Apr 22, 2002 8:51 am

Hello
How could i use the DynamicDataDemo.java example to plot
horizontal bars instead of points?
Urgent help is required....
Thanks in advance
Gaurav Kathotia

David Gilbert

Re: DynamicDataDemo

Post by David Gilbert » Tue Apr 23, 2002 6:35 am

gaurav kathotia wrote:
> How could i use the DynamicDataDemo.java example to plot
> horizontal bars instead of points?

The DynamicDataDemo class uses a TimeSeriesCollection. You can use this to plot a VerticalXYBarChart...just change the call to ChartFactory.createTimeSeriesChart(...) to ChartFactory.createVerticalXYBarChart(...).

But there isn't a HorizontalXYBarChart yet, so you can't use TimeSeriesCollection for horizontal bars.

You could use the horizontal bar chart that is based on a CategoryDataset, but then you would need to rewrite lots more code since TimeSeriesCollection does not implement CategoryDataset.

Regards,

DG.

Locked