Save chart as png with a Custom Legend Tool on it

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Hardee
Newbie
Newbie
Posts: 22
Joined: Tue Nov 21, 2006 12:00 am

Save chart as png with a Custom Legend Tool on it

Post by Hardee » Wed Jan 05, 2011 5:35 pm

Hello,

I have a chart that actually doesn't have a series, but has a Custom Legend Tool with some rows and two columns. I populate the data with assignments to the Legend tool grid cells. Everything looks good on the screen, but I need to save the chart, with the title and the custom legend tool to a png file. The title and the tool border are saved to the file, but inside the border all is blank. The rows and columns of the grid are not being saved to the png file.

Is there a trick to saving the custom legend tool along with the rest of the chart? I have Teechart Pro 2010 and Delphi 2009.

Thanks very much for your help.

Here is the code for my CustomLegendTool.

with CustomLegendTool do
begin
AllowDrag := false;
AllowResize := false;

Left := Chart1.Left - 50;
Top := Chart1.Top + 40;
Height := Chart1.Height - 60;
Width := Chart1.Width - 50;

Color := RGB(255,250,250);

with Grid do
begin
ColCount := 2;
RowCount := 4;
ColWidths[0] := 200;
ColWidths[1] := 40;
Left := Chart1.Left - 40;
Top := Chart1.Top + 50;
Height := Chart1.Height - 100;
//Width := Chart1.Width - 50;

Color := RGB(255,250,250);

Cells[0,0] := 'Low Flood Risk';
Cells[0,1] := 'Riverine 1% Annual Chance Flood Zone';
Cells[0,2] := 'Coastal 1% Annual Chance Flood Zone';
Cells[0,3] := '0.2% Annual Chance Flood Zone';
end;

Grid.GridLineWidth := 0;
end;



Hardee

Washington, DC

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Save chart as png with a Custom Legend Tool on it

Post by Yeray » Tue Jan 11, 2011 1:07 pm

Hi Hardee,

Exporting the demo from the features demo at What's New ?\Welcome !\New Chart Tools\Custom Legend it seems to look fine:
chart1.png
chart1.png (15.45 KiB) Viewed 4772 times
So I think it could be something in your code.
Could you please arrange a simple example project we can run a-is to reproduce the problem here? Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply