Hi,
Using TChart in my application I do not use/show the ChartLegend, rather I have my own 'Legend' using some CheckListBoxes to Hide/Show ChartSeries.
Now when I preview/print my TChart I would like to show the standard ChartLegend.
So my questions is: Is there a way to display the ChartLegend on Print/Preview without having the Chart.Legend.Visible := true; in my main application?
Thanks,
Leo
Show Chart Legend on Preview/Print
Re: Show Chart Legend on Preview/Print
Hello Leo,
If you aren't calling print/printpreview manually in a button or similar, you could use events. Ie:
If you aren't calling print/printpreview manually in a button or similar, you could use events. Ie:
Code: Select all
procedure TForm1.Chart1BeforeDrawChart(Sender: TObject);
begin
if Chart1.Printing then
Chart1.Legend.Show;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Chart1.Legend.Hide;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Show Chart Legend on Preview/Print
Thank you, that did the trick
Leo
Leo