How to make space in the legend for drawing?
Posted: Mon Jan 08, 2024 2:37 pm
I was using TeeChart Pro version 2011 and used the following to make space in the legend to the left, for drawing the contour line types (in C++)
This placed the symbols to the left of the text (which is right aligned), and left space on the left for drawing.
Then drew the lines in the legend to the left of the symbols, text using the
How to I get the symbols to lie just before the right aligned text, as before, when I add extra space to the legend on the left?
Code: Select all
GetLegendRectEvent(TCustomChart *Sender, TRect &Rect)
{
int ExtraLegendWidth=floor((double)(Rect.Right-Rect.Left)*0.5+0.5);
if (ExtraLegendWidth<35) ExtraLegendWidth=35;
Rect.Left-=ExtraLegendWidth;
}
Then drew the lines in the legend to the left of the symbols, text using the
ChartAfterDrawEvent
Now I am using Teechart Pro 2023 and using the same code, the legend places the symbols as left aligned and the text as right aligned, so that the lines are now drawn through the symbols.
I have tried setting TextSymbolGap
in the GetLegendRectEvent
, but this does not seem to help.How to I get the symbols to lie just before the right aligned text, as before, when I add extra space to the legend on the left?