ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Way to wrap legend text when using 1 column layout i.e. the items need to line up vertically
Posted by John Doe on Jul-25-2012 01:03
Is there a way to wrap legend text when using 1 column layout i.e. the items need to line
up vertically + wrap the text for long names?

  Re: Way to wrap legend text when using 1 column layout i.e. the items need to line up vertically
Posted by Peter Kwan on Jul-25-2012 23:04
Hi John,

If you are using vertical label layout, you can call setMaxWidth on the LegendBox object to set its maximum width. For example, in Java/C#:

c.getLegend().setMaxWidth(160);

If the legend text is too long, ChartDirector will wrap the text so that the legend box is within 160 pixels wide.

Hope this can help.

Regards
Peter Kwan

  Re: Way to wrap legend text when using 1 column layout i.e. the items need to line up vertically
Posted by John Doe on Aug-16-2012 05:57
Hmm...That doesn't really solve the problem. We have legend items that are very small
and legend items that are long, and we need both to line up vertically. When I try to your
method, the longer names get wrapped around, leaving the rest of the space empty. This
is not ideal. Longer names should take up all the space.

Is there any other way to get this done?

  Re: Way to wrap legend text when using 1 column layout i.e. the items need to line up vertically
Posted by John Doe on Aug-16-2012 06:01
Hmm well never mind, I used addLegend2(<...>, <...>, 1, <...>, <...>), and that seems
to work...