setVerticalLabels(true) in VerticalBarChart3D

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

setVerticalLabels(true) in VerticalBarChart3D

Post by Sandeep » Wed Aug 14, 2002 6:04 am

Dear Friends,

I am trying to display the labels on the x-axis of VerticalBarChart3D
vertically. But I see that the following piece of code does not seem to take effect. What am I doing wrong?

CategoryDataset intrArrCds = new DefaultCategoryDataset(new double[1][0]);
JFreeChart intrArrHist = ChartFactory.createVerticalBarChart3D(
"Histogram",
"Time(sec)",
"Freq",
intrArrCds,
false);
com.jrefinery.chart.CategoryPlot cPlot = intrArrHist.getCategoryPlot();
cPlot.setVerticalLabels(true);

Thanks,
Sandeep

David Gilbert

Re: setVerticalLabels(true) in VerticalBarChart3D

Post by David Gilbert » Wed Aug 14, 2002 6:49 am

Hi Sandeep,

The setVerticalLabels(...) method you are calling in the CategoryPlot class controls the orientation of the value labels on the bars (if they are visible).

You need to call the setVerticalCategoryLabels(...) method in the HorizontalCategoryAxis class, like this:

HorizontalCategoryAxis axis = (HorizontalCategoryAxis)cPlot.getDomainAxis();
axis.setVerticalCategoryLabels(true);

Regards,

DG.

Locked