Overlay chart

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

Overlay chart

Post by Massimiliano » Fri Aug 09, 2002 5:05 pm

I need to have an overlay chart with a stakedVerticalBar and time series chart.

No problem to add the time series but i have some problem to create the stakedVerticalBar.
In particular i've created an OverlaidXYPlot then
CategoryDataset dati = createBarData();
JFreeChart barre = ChartFactory.createStackedVerticalBarChart3D("","","",dati,false);
.
plot.add(barre.getXYPlot);

But i have errors.
How can i do??

David Gilbert

Re: Overlay chart

Post by David Gilbert » Mon Aug 12, 2002 10:47 am

It is not possible to mix charts that use CategoryPlot with charts that use XYPlot, because they have different domain axes (one is based on categories, the other is based on numerical values).

Regards,

DG.

Massimiliano

Re: Overlay chart

Post by Massimiliano » Mon Aug 12, 2002 11:05 am

Thank you but ...
how can i do if i must have a chart in which there is a staked bar with two time series chart overlayed???


Regards
Massimiliano

David Gilbert

Re: Overlay chart

Post by David Gilbert » Mon Aug 12, 2002 11:28 am

I think it wouldn't be too difficult to modify the VerticalXYBarRenderer class (which draws basic bar charts using the XYPlot class) to draw stacked bars. These could be overlaid with a time series chart.

I'd encourage you to have a go at this. I would do it myself, but I have a million other things to do right now...

Regards,

DG.

Locked