Page 1 of 1
Legend hides automatically
Posted: Tue Jun 15, 2004 11:04 am
by 9335230
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.
Posted: Tue Jun 15, 2004 11:26 am
by Marjan
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.
Posted: Tue Jun 15, 2004 12:23 pm
by 9335230
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.
Legend becomes hidden in case of long legend texts
Posted: Fri Sep 24, 2004 11:16 am
by 9338502
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
Posted: Thu May 31, 2007 8:44 am
by 9643156
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
Posted: Thu May 31, 2007 9:15 am
by narcis
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.
Posted: Thu May 31, 2007 10:24 am
by 9643156
Hello Narcís,
thank you for your quick reply! You guys seem to be very service-minded towards your customers. Big credits.
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.
Posted: Thu May 31, 2007 11:02 am
by narcis
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.
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.
Posted: Thu May 31, 2007 11:07 am
by 9643156
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.