Truncating data point label

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

Truncating data point label

Post by Suprigya » Wed Oct 23, 2002 10:32 pm

Hi,

Could someone please suggest what can I do so that the data point labels are fully displayed. The data point labels at the top are only half displayed. Their upper part is invisible. This is happening only for the data point labels at the top.

Thanks.

Dave Gilbert

Re: Truncating data point label

Post by Dave Gilbert » Wed Oct 23, 2002 10:47 pm

Currently the auto-range calculation for the axis only looks at the data, it doesn't know that the renderer is drawing labels for the data point.

One thing you can do is set a bigger margin at the top of the axis, something like this:

CategoryPlot plot = myChart.getCategoryPlot();
ValueAxis rangeAxis = plot.getRangeAxis();
rangeAxis.setUpperMargin(0.10); // set the margin to 10%

The default upper margin is five percent, increasing it will leave more room for the labels.

Regards,

DG.

Suprigya

Re: Truncating data point label

Post by Suprigya » Wed Oct 23, 2002 11:04 pm

Thanks. by increasing the upper margin to 0.14, I am able to display the labels properly.

Locked