(Barchart) labels get cut off even if there's enough space

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Guus
Posts: 4
Joined: Fri Dec 31, 2004 12:01 pm
Location: the Netherlands
Contact:

(Barchart) labels get cut off even if there's enough space

Post by Guus » Tue Feb 01, 2005 3:11 pm

I created a vertical-aligned barchart. Using org.jfree.chart.axis.CategoryAxis.setMaxCategoryLabelWidthRatio(0.5f) I made sure that the border between the category labels on the left side and the bars on the right side of the graph is exactly in the middle of the graph.

Somehow, some of the labels still get cut off (ending with ...), while there's a lot of space available. How do I make sure that my entire label is visible?
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.

gandhi
Posts: 11
Joined: Wed Nov 17, 2004 5:24 pm

Post by gandhi » Wed Feb 02, 2005 11:26 pm

I had similar problems with a bar chart, plot orientation vertical (that is, the bars extending from the bottom to the top).

I also played around with setMaxCategoryLabelWidthRatio(float). But what I found in the documentation didn't really help me (maybe I just didn't understand or didn't look at the right place).

If it defines the border between space available for the labels and space available for the plot, then you're right and it doesn't work as expected. And only values between 0.0f and 1.0f would make sense.

I had success with increasing that value to, say 5.0f or 10.0f. It seems to define some kind of ratio between label space and plot space ... but I am not sure. That was more of a guess than anything else.

Maybe somebody involved in the code could help out ?

Locked