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
setVerticalLabels(true) in VerticalBarChart3D
Re: setVerticalLabels(true) in VerticalBarChart3D
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.
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.