Category labels

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

Category labels

Post by Marta » Tue Jul 30, 2002 11:02 am

Hi:

I have a VerticalBarChart with vertical category labels ,the problem is that those labes are too long .

Is there a way to make each label be drawn in two lines?

I have a fix space for the graph so when the labels are too long ,I have a very little space left for the chart.

Thank you in advance.

David Gilbert

Re: Category labels

Post by David Gilbert » Tue Jul 30, 2002 10:01 pm

There's no code to do that in the current version. Code contributions are welcome though. If you decide to modify the HorizontalCategoryAxis, there are four methods that you will need to modify:

public void draw(...);
To modify the way the category labels are drawn.

public Rectangle2D reserveAxisArea(...);
The height will depend on how the category labels are laid out;

public double reserveHeight(...);
Again the height will depend on how the category labels are laid out;

public void refreshTicks(...);
There is some layout being done in this method;

Regards,

DG.

Locked