Save chart as png with a Custom Legend Tool on it
Posted: 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
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