Create a teechart dynamically
Posted: Thu Sep 25, 2008 10:14 am
Hi Narcis,
Why this code doesn't functions ?
Thank you for your help
Didou
Why this code doesn't functions ?
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
Chart1: TChart;
begin
try
Chart1 := TChart.Create(self);
Chart1.Top := 0;
Chart1.Left := 0;
Chart1.Height := 300;
Chart1.Width := 500;
Chart1.RemoveAllSeries;
Chart1.AddSeries(TBarSeries.Create(Self));
Chart1[0].Clear;
Chart1[0].Add(123, 'ABC', clRed);
Chart1[0].Add(456, 'DEF', clBlue);
Chart1[0].Add(321, 'GHI', clGreen);
Chart1[0].Marks.Style := smsValue;
finally
Chart1.Free;
end;
end;
Thank you for your help
Didou