How to create a multiline legend entry

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Rolf Fankhauser
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

How to create a multiline legend entry

Post by Rolf Fankhauser » Thu Dec 16, 2004 2:11 pm

I have a chart with long legend entries. Therefore the width of the chart is smaller than the legend. I would like to keep the legend on the right side of the chart. How can I split the legend entries to two lines? I created the text of the entries during run-time.

Thanks in advance.

Kind regards,

Rolf

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu Dec 16, 2004 4:03 pm

Hi, Rolf.

This feature is not yet supported. You'll have to use chart OnGetLegend** events to customize individual legend item position and text. There are some examples about customizing legend items available in TeeChart demo.
Marjan Slatinek,
http://www.steema.com

Rolf Fankhauser
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

Post by Rolf Fankhauser » Fri Dec 17, 2004 10:36 am

Hi Marjan,

I didn't find an example with multiline legend entries. My wish is to automate the multiline option: if the string for the legend entry contains a line break it should automatically generate two lines. The only way I see is to use OnGetLegendText:

- Check if there is a line break in the legend entry
- If yes then
1.solution: Increase the space between the entries (Is it only possible for all spaces , not for individual between two entries?) and write the rest of the string in the space (how to do that?).
2.solution: Make additional entries and write the text there. But is it possible to make entries without series? Do I have to create empty series to have additional legend entries? I use checkboxes. Is it possible to hide the checkboxes and legend symbol for some entries?

Maybe you know another, better workaround?

Kind regards,

Rolf

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Dec 17, 2004 12:14 pm

Hi Rolf,

the best workaround I can think of, is the custom drawing on the Legend. There's an example in the Demo Features project under All Features -> Welcome ! -> Miscellaneous -> Legend -> Drawing more text

Post Reply