Extra Legend Tool: Large Symbols Overwrite Legend Item Text

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
erzsebet
Newbie
Newbie
Posts: 21
Joined: Tue Apr 13, 2010 12:00 am

Extra Legend Tool: Large Symbols Overwrite Legend Item Text

Post by erzsebet » Mon Oct 04, 2010 9:07 pm

Hello!

My application needs to display a second legend using a TExtraLegendTool. For each legend item, the symbol will be a different sized square which will correspond to the point size of that data item as drawn on the graph. My problem is that when I get the symbols the way I want them, the legend item text is covered up by the symbol.

For example:
SizeLegendTheWayItReallyIs.PNG
SizeLegendTheWayItReallyIs.PNG (71.88 KiB) Viewed 3162 times
I would like the text to adjust to the right, more like this :
SizeLegendTheWayIWantIt.PNG
SizeLegendTheWayIWantIt.PNG (52.96 KiB) Viewed 3160 times
Other than artificially padding the left hand side of the text with spaces, how can I convince the text to move over far enough to not be overwritten by the symbol?

Thank you,

erzsebet

erzsebet
Newbie
Newbie
Posts: 21
Joined: Tue Apr 13, 2010 12:00 am

Re: Extra Legend Tool: Large Symbols Overwrite Legend Item Text

Post by erzsebet » Mon Oct 04, 2010 11:29 pm

It's just me again...

Is there any way that I could configure a relatively sized legend that is not a TExtraLegendTool and is aligned to the bottom of the chart? The code I have now for a default, bottom aligned legend with various sized rectangles overwrites both the text and the boundaries of the legend panel. Here's a picture of what I mean:
SizeLegendBottomAlignedUgliness.png
SizeLegendBottomAlignedUgliness.png (5 KiB) Viewed 3128 times
Thanks!!

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

Re: Extra Legend Tool: Large Symbols Overwrite Legend Item Text

Post by Narcís » Wed Oct 06, 2010 9:54 am

Hi erzsebet,
Other than artificially padding the left hand side of the text with spaces, how can I convince the text to move over far enough to not be overwritten by the symbol?
You could use custom symbols doing something as in the All Features\Welcome!\Miscellaneous\Legend\Symbol OnDraw example at the new features demo, available at TeeChart's program group.
Is there any way that I could configure a relatively sized legend that is not a TExtraLegendTool and is aligned to the bottom of the chart?
Does the Symbol OnDraw approach helps on this?
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

erzsebet
Newbie
Newbie
Posts: 21
Joined: Tue Apr 13, 2010 12:00 am

Re: Extra Legend Tool: Large Symbols Overwrite Legend Item Text

Post by erzsebet » Thu Oct 07, 2010 8:50 pm

Narcís, hello -

I was already leveraging the Chart.Legend.Symbol.OnDraw event to create the differently sized squares. I have also overloaded the Chart.OnGetLegendText event to customize the strings displayed next to each of the sized symbols. I was not able to get these events to produce the look I wanted without calculating an amount of 'padding' I needed to add to the right-side of the text to force enough space for the symbol. That is okay, because we did get the legend looking really nice - mostly thanks to the super component you all provide!

As far as the bottom aligned legend goes, we decided to drop that as a requirement, and always display the sized legend on the right side of the chart.

Thank you very much for getting back to me,

-erzsebet

Post Reply