TChart legend woes

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jorg B
Newbie
Newbie
Posts: 6
Joined: Thu Mar 01, 2001 5:00 am
Location: Netherlands

TChart legend woes

Post by Jorg B » Tue Feb 22, 2005 1:06 pm

Hi,

I have a TChart (5.01) in which a variable amount of series can be placed.

I have a legend at the bottom, and have set the Legend.ResizeChart to true, and some margin (like 4%) to bottom.

Sometimes the legend is nicely spread out like;

--
Series 1 Series 2 Series 3
Series 4
--

But sometimes the legend refuses to do this, but it stacks the legend like;

--
Series 1
Series 2
Series 3
Series 4
---

Is there a property that prevents stacking it like this ? I have 7 series max, and would like to have them ordered 3 on a row max, or else the chart gets drastically resized.

Thanks in advance,
- Jorgen

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

Post by Pep » Wed Feb 23, 2005 7:41 pm

Hi Jorgen,

you could try using :
Chart1.Legend.MaxNumRows := 3;
This will allow to show 3 Rows as maximum.

Jorg B
Newbie
Newbie
Posts: 6
Joined: Thu Mar 01, 2001 5:00 am
Location: Netherlands

Post by Jorg B » Thu Feb 24, 2005 10:03 am

Thanks Pep!

But would that not just constrain the number of items on the row to max 3? Right now it does not even reach 3, it sticks to 1 item per row and stacks them under each other, when there is no real need for it.

Thanks again,
- Jorgen

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 25, 2005 10:41 am

Hi Jorgen,

There's no way of doing it directly, la best way is creating a custom legend with the canvas using Annotation tool for example.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Jorg B
Newbie
Newbie
Posts: 6
Joined: Thu Mar 01, 2001 5:00 am
Location: Netherlands

Post by Jorg B » Fri Feb 25, 2005 1:11 pm

Ok Guys,

Here's the kicker! The problem was that I displayed one extra series in my legend which was containing a strange symbol (e.g. with a circle in it) all other line series that are normal series. Whenever I remove that one from the legend, the series display 3x? rows. Thanks a lot for all the help, it appeared some weird artefact in TChart.


- Jorgen

Post Reply