Hi,
in a barchart I have an axis label very long (~50c.) which is taking too much space.
As I have to keep an horizontal orientation, I would like to know if it is possible to split it on different lines ?
I tried to modify it by inserting carriage returns but apparently JFreeChart is ignoring them.
Has anyone a solution for this problem ?
Thanks.
Split a axis label on different lines in a barchart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes, unfortunately the existing code won't support multi-line axis labels. Changing it wouldn't be so hard...you'd need to change two methods in the Axis class:
getLabelEnclosure() - this returns the dimensions of the label, and is used for layout purposes;
drawLabel() - does the actual label drawing.
There is some code in JFreeChart/JCommon that can help with drawing multiline text - see the TextBlock class in JCommon.
getLabelEnclosure() - this returns the dimensions of the label, and is used for layout purposes;
drawLabel() - does the actual label drawing.
There is some code in JFreeChart/JCommon that can help with drawing multiline text - see the TextBlock class in JCommon.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program