Page 1 of 1

Extra Legend Tool: Large Symbols Overwrite Legend Item Text

Posted: Mon Oct 04, 2010 9:07 pm
by 16555616
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 3164 times
I would like the text to adjust to the right, more like this :
SizeLegendTheWayIWantIt.PNG
SizeLegendTheWayIWantIt.PNG (52.96 KiB) Viewed 3162 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

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

Posted: Mon Oct 04, 2010 11:29 pm
by 16555616
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 3130 times
Thanks!!

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

Posted: Wed Oct 06, 2010 9:54 am
by narcis
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?

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

Posted: Thu Oct 07, 2010 8:50 pm
by 16555616
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