Overlaid StackedBarChart and line charts.

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

Overlaid StackedBarChart and line charts.

Post by Deepak Bhatt » Mon Jan 13, 2003 4:42 pm

Hi,

I need to make a chart that will have stacked Bar chart and 2 line charts overlaid.
I am using OverlaidVerticalCategoryPlot class.But when ever I am drawing a Verticalcategoryplot it,s plotting fine. If I add the same VerticalCategoryPlot to OverlaidCategoryPlot it draws an empty chart.

The code is as follows..

------------------------------------------------------------------------------------------
String ctitle = "Strategie Sicherheit";
String xTitle = "Zeitraum (in Jahren)";
String yTitle = "Performance";

HorizontalCategoryAxis xAxis = new HorizontalCategoryAxis(xTitle);
xAxis.setTickMarksVisible(true);

VerticalNumberAxis yAxis = new VerticalNumberAxis(yTitle);

CategoryDataset dataset = createDataset1(list.get(0));

VerticalBarRenderer barRenderer = null;
barRenderer = new VerticalBarRenderer();
VerticalCategoryPlot bars = null;
bars = new VerticalCategoryPlot(dataset, null, null, barRenderer);
bars.setLabelsVisible(true);

OverlaidVerticalCategoryPlot plot = new OverlaidVerticalCategoryPlot(xAxis,yAxis,categories);

plot.add(bars);
JFreeChart chart = new JFreeChart(plot);
return chart;

----------------------------------------------------------------------------------------------

Any pointers on the above problem would be of great help.
I am unable to draw a single chart using OverlaidVerticalCategoryPlot class. What could be wrong ??

Regards,
Deepak.

Locked