Problem on create category vertical bar chart

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

Problem on create category vertical bar chart

Post by Carrie » Thu Feb 27, 2003 4:57 am

I want to product a vertical bar chart to show no. of mail send by each person - where y-axis show "No. of mail" and x-axis show the "Each person name" (it contains about 40 people)

It seems that CategoryDataset is suitable for me in this case, but I am not sure which class is used to add the person names in x-axis.. and it seems that there is not enough space to print out all 40 person name in the x-axis.

I want to find some sample code to see how to do this.

Do anyone can help??

Many Thanks
Carrie

Carrie

Re: Problem on create category vertical bar chart

Post by Carrie » Thu Feb 27, 2003 7:49 am

Just to enhance my question. I found in this forum that XYPlot allow to print the x-axis vertically.
XYPlot plot= myChart.getXYPlot();
HorizontalDataAxis axis = (HorizontalDataAxis) plot.getDomainAxis();
axis.setVerticalTickLabels(true);

Is it possible to do it in my case??

Many Thanks
Carrie

David Gilbert

Re: Problem on create category vertical bar chart

Post by David Gilbert » Fri Feb 28, 2003 1:47 am

Yes, a similar approach works:

CategoryPlot plot = myChart.getCategoryPlot();
HorizontalCategoryAxis axis = (HorizontalCategoryAxis) plot.getDomainAxis();
axis.setVerticalTickLabels(true);

Regards,

Dave Gilbert

Locked