Legend hides automatically

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
beetle
Newbie
Newbie
Posts: 59
Joined: Fri Dec 12, 2003 5:00 am

Legend hides automatically

Post by beetle » Tue Jun 15, 2004 11:04 am

Hi!

I have a Chart inside a form with alignment=alClient and the legend is
visible with laBottom alignment. Sometimes the Legend hides When I resize the form (always when I shrink the width, not the height), but the 'Visible' property of the Legend is still 'true'.
When I increase the form height the legend appears again.

Any Ideas??

Thanks in advance.

Beetle.

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

Post by Marjan » Tue Jun 15, 2004 11:26 am

Hi.

Using TeeChart v7.0 I was not able to replicate the problem you described. Which Teechart version are you using ? How many legend entries are you displaying ? Are the entries in single or multiple lines ? Perhaps it would help increasing Legend.MaxNumRows property to greater value.

If it still doesn't work, please post a sample application at steema.public.attachments newsgroup and I'll try to run/test/debug it on my machine.
Marjan Slatinek,
http://www.steema.com

beetle
Newbie
Newbie
Posts: 59
Joined: Fri Dec 12, 2003 5:00 am

Post by beetle » Tue Jun 15, 2004 12:23 pm

Hi again,

I have just to replicate the problem in a new project and the causes seems to be the width of the text displayed in the legend entries (Title property in my project). When you shrink the chart and the chart is not wide enough to display the legend text, the legend hides.

(I have TeeChart 7)

Is possible to display the legend although the text is wider than
the chart (truncating the text)?

Thanks.
Beetle.

Dobedani
Newbie
Newbie
Posts: 5
Joined: Tue Aug 10, 2004 4:00 am
Location: Wageningen, the Netherlands
Contact:

Legend becomes hidden in case of long legend texts

Post by Dobedani » Fri Sep 24, 2004 11:16 am

Dear 9335230, Marjan and others,

I experienced the same problem. It took me some time before I realised that the legend becomes hidden when the legend text - or in other words the series' title - is longer than usual. That is: longer than the width of the chart. May I ask for a new feature here? It would be nice if long texts llike that could optionally be truncated or if a warning can be given somehow. TIA

Kind regards,
Dobedani :idea:

SSkov
Newbie
Newbie
Posts: 15
Joined: Thu Nov 23, 2006 12:00 am
Contact:

Post by SSkov » Thu May 31, 2007 8:44 am

I see this is an old issue, but I have a similar problem on the ActiveX side, and just wanted to know if any solution has been developed since Dobedani's post.

Personally I would like to be able to configure the legend to simultaneously:

- be positioned relative to the top/left corner of the panel, not the chart
- have the chart move/resize to make room for the legend
- clip its content if it extends beyond the panel, not the chart.
(- maybe even fire an event if anything has been clipped)

Best regards

Steffen Skov
Senior Consultant
SPT Group

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

Post by Narcís » Thu May 31, 2007 9:15 am

Hi Steffen,
I see this is an old issue, but I have a similar problem on the ActiveX side, and just wanted to know if any solution has been developed since Dobedani's post.
As far as I can see, no project was provided and my colleague Marjan couldn't reproduce the issue here. Could you please send us a simple example project we can run "as-is" to reproduce the issue here and let us know which TeeChart version are you using?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Personally I would like to be able to configure the legend to simultaneously:

- be positioned relative to the top/left corner of the panel, not the chart
This is possible using legend's custom positioning. You'll find an example of this at All Features\Welcome!\Miscellaneous\Legend\Custom position in the features demo, which can be found at TeeChart's program group.
- have the chart move/resize to make room for the legend
This is default behaviour. In which circumstances this doesn't happen? Could you please send us a simple example project reproducing this? Please notice that the margin between the chart and the legend can be set using TChart1.Legend.HorizMargin.

Also, in v8, the version we are currently working in, we have included CustomChartRect property which will allow users define a customized ChartRect position and dimensions.
- clip its content if it extends beyond the panel, not the chart.
(- maybe even fire an event if anything has been clipped)
There's no event for that at the moment. However, this should happen automatically, doesn't it? Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
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

SSkov
Newbie
Newbie
Posts: 15
Joined: Thu Nov 23, 2006 12:00 am
Contact:

Post by SSkov » Thu May 31, 2007 10:24 am

Hello Narcís,

thank you for your quick reply! You guys seem to be very service-minded towards your customers. Big credits. :D

I am using TeeChart AX version 7.

Unfortunately I do not have any sample code readily available. I am fairly certain, though, that you will be able to reproduce the problem if you have a legend with fairly long text, while resizing the plot window so the chart becomes narrower than the legend.


To reformulate my question:

I am aware that the chart resizes/moves automatically by default, but as soon as I set a custom position for the legend, this feature seems to be automatically turned off (I have tried this in the TeeChart configuration editor only, so I am not to claim that these features cannot be activated simultaneously programmatically).

As for my second last point, I have never experienced that the legend is clipped in any way. It merely disappears totally when its width exceeds the width of the chart. Additionally, I would have liked it to clip to the boundaries of the whole panel, and not just to the width of the chart.
Best regards

Steffen Skov
Senior Consultant
SPT Group

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

Post by Narcís » Thu May 31, 2007 11:02 am

Hi Steffen,
thank you for your quick reply! You guys seem to be very service-minded towards your customers. Big credits.
Thank you very much. :D
Unfortunately I do not have any sample code readily available. I am fairly certain, though, that you will be able to reproduce the problem if you have a legend with fairly long text, while resizing the plot window so the chart becomes narrower than the legend.
Ok, picking information from all the posts in this thread I've finally been able to reproduce the issue here. This happens when the legend is aligned at the bottom of the chart, there are long texts on it and the chart width is smaller than the legend's width.

I've added this issue to our wish-list to be enhanced for future releases.
I am aware that the chart resizes/moves automatically by default, but as soon as I set a custom position for the legend, this feature seems to be automatically turned off (I have tried this in the TeeChart configuration editor only, so I am not to claim that these features cannot be activated simultaneously programmatically).
In that case, you should set legend's position using chart's relative positions, for example, positions relative to: axes position, series points, ... You could do this in a method that should be called after the chart is being zoomed, unzoomed, scrolled, resized, etc. Please notice that the TeeChart has events for all those cases.

You can obtain relative positions coordinates as I told on this thread.
As for my second last point, I have never experienced that the legend is clipped in any way. It merely disappears totally when its width exceeds the width of the chart. Additionally, I would have liked it to clip to the boundaries of the whole panel, and not just to the width of the chart.
Using TeeChart Pro v7.0.1.4 ActiveX, which is the latest version available at the client area, I've checked that the legend disappearing issue happens when the legend's width is greater than the whole TeeChart object width, not the ChartRect's (area where the series are drawn and usually delimited by the axes) width. Have I misunderstood your request? Which exact TeeChart version are you using?

Thanks in advance.
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

SSkov
Newbie
Newbie
Posts: 15
Joined: Thu Nov 23, 2006 12:00 am
Contact:

Post by SSkov » Thu May 31, 2007 11:07 am

Thanks Narcís,

I will try the approach you describe.

The exact version, which I am using is v7.0.1.2, so I will download the newest update before continuing.

Thanks again for your help.
Best regards

Steffen Skov
Senior Consultant
SPT Group

Post Reply