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!!!
labels cropped
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


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:
And and image of the chart with the labels clipping:

Thanks a lot!!!
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);

Thanks a lot!!!
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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.
My only other suggestion would be to try a different JRE version and see if that makes any difference.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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!cristo_haris wrote:Me too suffering from same problem
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

