Overlaid XY Plot with Bar Chart

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

Overlaid XY Plot with Bar Chart

Post by yongsing » Tue Oct 01, 2002 10:00 am

Is it possible to have an XY plot (eg. sine curve) overlaid with a vertical bar chart? The plot is a smooth curve, but the bars lie on discrete x-axis values.

Thanks.

David Gilbert

Re: Overlaid XY Plot with Bar Chart

Post by David Gilbert » Tue Oct 01, 2002 11:29 pm

You can use the VerticalXYBarPlot to do a simple bar chart and overlay it with a regular XYPlot showing a sine curve (actually, just an approximation of a sine curve, since JFreeChart doesn't really plot functions). The VerticalXYBarPlot does not have the same range of features as the regular bar plots though.

Regards,

DG

yongsing

Re: Overlaid XY Plot with Bar Chart

Post by yongsing » Wed Oct 02, 2002 2:45 am

Hi David,

I didn't find any class called VerticalXYBarPlot.


Regards,
Yong Sing

David Gilbert

Re: Overlaid XY Plot with Bar Chart

Post by David Gilbert » Wed Oct 02, 2002 1:28 pm

Sorry, I meant to say VerticalXYBarRenderer, you plug it in to a regular XYPlot, making sure that your dataset is an instance of IntervalXYDataset.

Regards,

DG.

Locked