TChart V8.08
I use legend with checkboxes positioned at the top.
When at run time the text is changed, the checboxes move into the text, even if ColumnWidthAuto=TRUE.
Then after some trials I found this to prevent that:
dbChart1.Legend.ColumnWidthAuto:=False;
dbChart1.Legend.ColumnWidths[0]:=100;
dbChart1.Draw;
dbChart1.Legend.Items[1].text:= '-modified-';
dbChart1.Draw;
But as soon as the Tchart width is changed at runtime, the checkboxes move over the text again
What can be done to prevent that?
P.S. This only happens once the text is changed.
When using the default text, the positions are always correct.
Legend with Checkbox misaligned
Re: Legend with Checkbox misaligned
Hi,
I'm trying to reproduce this with the following project but I can't: I can change the legend font size and then resize the chart without noticing any strange behaviour.
I checked it both with TeeChart v8 and the actual sources.
Could you please modify the project above so we can reproduce the problem here?
Thanks in advance.
I'm trying to reproduce this with the following project but I can't: I can change the legend font size and then resize the chart without noticing any strange behaviour.
I checked it both with TeeChart v8 and the actual sources.
Could you please modify the project above so we can reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Legend with Checkbox misaligned
Thanks Yeray,
Now do this:
Put a button on it with this code
Chart1.Legend.Items[1].text:= '-modified-';
Now you will see the effect that checkboxes are misplaced
Also: At runtime drag the right/left form border to make it wider / smaller, you will see that checkboxes are moved while the text-position remains unchanged.
Now do this:
Put a button on it with this code
Chart1.Legend.Items[1].text:= '-modified-';
Now you will see the effect that checkboxes are misplaced
Also: At runtime drag the right/left form border to make it wider / smaller, you will see that checkboxes are moved while the text-position remains unchanged.
Re: Legend with Checkbox misaligned
Hi,
Right. With this, I can reproduce it now with TeeChart v8 even without changing the legend font.
However, I can't reproduce this with the actual version.
Here it is the new version of the testing application with an exe compiled with the latest TeeChart v2013.09
Right. With this, I can reproduce it now with TeeChart v8 even without changing the legend font.
However, I can't reproduce this with the actual version.
Here it is the new version of the testing application with an exe compiled with the latest TeeChart v2013.09
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Legend with Checkbox misaligned
Thanks Yeray,
Yes, you only need to change the text.
Your .exe works fine indeed.
Is there any workaround that I could do in V8.08 to get the same result?
Yes, you only need to change the text.
Your .exe works fine indeed.
Is there any workaround that I could do in V8.08 to get the same result?
Re: Legend with Checkbox misaligned
Hi,
I can't think on a workaround for this right now... other than completely hiding the legend and drawing it yourself manually.
For this, you should calculating the positions for each item. Then, you should use custom drawing methods to draw both the checkboxes and the texts in the calculated positions. You should use these custom drawing methods at the AfterDraw event.
And you should force a chart repaint each time the chart is resized so the new positions can be recalculated and the new positions drawn.
I can't think on a workaround for this right now... other than completely hiding the legend and drawing it yourself manually.
For this, you should calculating the positions for each item. Then, you should use custom drawing methods to draw both the checkboxes and the texts in the calculated positions. You should use these custom drawing methods at the AfterDraw event.
And you should force a chart repaint each time the chart is resized so the new positions can be recalculated and the new positions drawn.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |