Modifying the X-axis in a barchart diagram

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

Modifying the X-axis in a barchart diagram

Post by Janne Ojansivu » Tue Mar 04, 2003 9:59 am

Hi!
My situation is that I have to change the x-axis values from "Day1, Day2, Day3 ..." to specific dates i.e. "3/5, 4/5,4/5..." .
Does anyone know how to do this more exactly (like sending in a String[] or something)?

Best regards
Janne Ojansivu

David Gilbert

Re: Modifying the X-axis in a barchart diagram

Post by David Gilbert » Tue Mar 04, 2003 10:03 am

These labels are obtained by the axis from the dataset, so you need to look at how you created your dataset.

Regards,

Dave Gilbert

Janne Ojansivu

Re: Modifying the X-axis in a barchart diagram

Post by Janne Ojansivu » Tue Mar 04, 2003 10:15 am

I'm not quite sure that I follow you; Do you mean that the data in the fetched dataset can be placed in the horizontal xAxis?

Regards,
Janne

David Gilbert

Re: Modifying the X-axis in a barchart diagram

Post by David Gilbert » Tue Mar 04, 2003 10:19 am

In a vertical bar chart, the x axis is a HorizontalCategoryAxis. It gets its labels from the column keys in the dataset. Take a look at the refreshTicks(...) method to see what is being done.

Regards,

Dave Gilbert

Locked