Page 1 of 1

Vanishing Legend

Posted: Tue Nov 28, 2006 11:02 pm
by 9237792
Hello,

I have a TChart with multiple TLineSeries. I have control that assigns a TCategoryItem to a TLineSeries. That TCategoryItem will decide whether TLineSeries.Visible is true or false. Since I inherited a lot of this code I'm faced with some confusing behaviour. I'm not sure if it's related to my control or the TChart. If I disable any lineseries (TLineSeries.Visible := false) except the first one in the TCategoryItems list - the legend remains; however, if I disable the first TCategoryItem from the list the legend disappears. What controls whether or not this legend is visible? How can I override this so I can figure out what's going on?

I can provide a screen capture if necessary. Just let me know where to dump it.

Thanks

Posted: Wed Nov 29, 2006 7:34 am
by Marjan
Hi.

If you're using multiple series then the solution to your problem might be setting chart Legend.LegendStyle property to lsSeries:

Code: Select all

Chart1.Legend.LegendStyle := lsSeries;

Posted: Fri Dec 01, 2006 2:42 pm
by 9237792
Thanks for the response.

I've tried your suggestion. Unfortunately it didn't make a difference. Let me know if you have any other suggestions.

Thanks

Posted: Fri Dec 01, 2006 2:50 pm
by narcis
Hi neo,

TeeChart's default behaviour is that the legend is visible while there's, at least, one active series in the chart. Couldn't it be that disabling the first series in your TCategoryItem disabled the other series that it contains?

If the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.