Wrapping of LegendItem Text

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jmoors
Posts: 7
Joined: Fri Jul 29, 2005 11:29 am

Wrapping of LegendItem Text

Post by jmoors » Fri Jul 29, 2005 11:36 am

Hi,

I have a LegendTitle with a number of categories which have long descriptions (Which are required). It is possible to reduce the width of the Legend title and wrap the corresponding LegendItem text?

I've tried to set the size of the LegendTitle by using the setWidth method however it doesn't seem to have any impact on the width.

Thanks

Jason.

jmoors
Posts: 7
Joined: Fri Jul 29, 2005 11:29 am

Post by jmoors » Sat Sep 03, 2005 9:58 pm

There doesn't seem to be a way for the legend to wrap text based on maximum width. However I found that you can put a '\n' character within the label to make the label split onto a new line.

e.g if you have legend label

"Cumulative Budget (Current Authorised)"

if you insert '\n' character

"Cumulative Budget\n (Current Authorised)"

The legend label is split over two lines

Cumulative Budget
(Current Authorised)

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 Sep 05, 2005 11:20 am

I'm still planning to do more work on the legend layout options. I think setting a maximum width to force wrapping would be a nice option to have.
David Gilbert
JFreeChart Project Leader

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

micmouse
Posts: 2
Joined: Wed Jan 23, 2008 2:18 pm

any news for that

Post by micmouse » Wed Jan 23, 2008 2:43 pm

are ther now improvements for that?

Locked