Tick label cut-off

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

Tick label cut-off

Post by Michael » Thu Oct 24, 2002 9:44 pm

I am having a problem with my last tick label being cut-off on a horizontal bar chart. I am using the NumberAxis to set the range from 0-1.5 and format the numbers as percent ("0%"). The last value is "150%" and I can't see all of the percent symbol. I can't use setUpperMargin() because this applies the margin inside the graph not out. The requirement is for the graph to end at 150% so increasing the range is not an option. Is there anyway to pad or apply a margin out side off the graph box so this does not happen?

Thanks

Dave Gilbert

Re: Tick label cut-off

Post by Dave Gilbert » Fri Oct 25, 2002 9:42 am

Try the setInsets(...) method in the plot class:

Plot plot = myChart.getPlot();
plot.setInsets(myNewInsets);

...to increase the spacing around the outside of the plot area.

Not very elegant, but I can't think of another way to solve the problem (apart from modifying the axis code).

Regards,

DG.

Michael

Re: Tick label cut-off

Post by Michael » Fri Oct 25, 2002 3:30 pm

Thanks, that worked!

Michael

Locked