labels cropped

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
krumel
Posts: 12
Joined: Sat Feb 18, 2006 11:00 pm
Location: Barcelona

labels cropped

Post by krumel » Mon Apr 03, 2006 9:35 am

Hi, I have a chart with 2 y-axis, my problem is that the labels of the ticks of the y axis are cropped because there's not enough space. Is there any way to solve this???.

thanks in advance!!!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Apr 03, 2006 10:48 am

Are the axes instances of NumberAxis? If so, there shouldn't be any clipping. Can you post a screen-shot and a small self contained demo showing the problem?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

krumel
Posts: 12
Joined: Sat Feb 18, 2006 11:00 pm
Location: Barcelona

Post by krumel » Mon Apr 03, 2006 9:50 pm

yes, I'm using NumberAxis. The labels are being clipped only when I don't specify a unit label for any of the 2 y-axis. The width of the the chart is static.

The code that I'm using is:

Code: Select all


NumberAxis vAxis0;
NumberAxis vAxis1;
// eje kWh
vAxis0 = (NumberAxis) plot.getRangeAxis();
//vAxis0.setLabel("m3");
//vAxis1 = new NumberAxis("kWh");
vAxis1 = new NumberAxis();
vAxis1.setTickLabelFont(new Font("Arial", Font.PLAIN, 8));
plot.setRangeAxis(0, vAxis0);
plot.setRangeAxis(1, vAxis1);
plot.setDataset(0, dataSet);
plot.setDataset(1, dataSetMultipleAxis);
plot.mapDatasetToRangeAxis(0, 0);
plot.mapDatasetToRangeAxis(1, 1);

And and image of the chart with the labels clipping:
Image

Thanks a lot!!!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Apr 04, 2006 4:56 pm

I see the problem, but it is hard to know if this is a bug in JFreeChart, the JRE, your font setup or something else. If you could post a self-contained demo, I could run it and see if the problem is reproduced on my system.

My only other suggestion would be to try a different JRE version and see if that makes any difference.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

cristo_haris
Posts: 7
Joined: Thu Jul 20, 2006 10:37 am

Post by cristo_haris » Tue Sep 12, 2006 2:55 pm

Me too suffering from same problem :(

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Sep 13, 2006 12:25 pm

cristo_haris wrote:Me too suffering from same problem :(
I'd love to trace the problem, but I haven't been able to reproduce it. Any details you can supply will be helpful. A self-contained demo application that shows the problem would be exceptional!
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked