Code: Select all
procedure TForm6.FormCreate(Sender: TObject);
var i,j: Integer;
tmpColorLine: TColorLineTool;
begin
Chart1.AddSeries(TBarSeries.Create(Self));
for i:=0 to 50 do
Chart1[0].Add(10*i);
tmpColorLine:=TColorLineTool.Create(Self);
tmpColorLine.Axis:=Chart1.Axes.Left;
tmpColorLine.Value:=100;
tmpColorLine.Pen.Color:=clRed;
tmpColorLine.Pen.Width:=2;
Chart1.Tools.Add(tmpColorLine);
tmpColorLine:=TColorLineTool.Create(Self);
tmpColorLine.Axis:=Chart1.Axes.Left;
tmpColorLine.Value:=200;
tmpColorLine.Pen.Color:=clGreen;
tmpColorLine.Pen.Width:=2;
Chart1.Tools.Add(tmpColorLine);
tmpColorLine:=TColorLineTool.Create(Self);
tmpColorLine.Axis:=Chart1.Axes.Left;
tmpColorLine.Value:=300;
tmpColorLine.Pen.Color:=clBlue;
tmpColorLine.Pen.Width:=2;
Chart1.Tools.Add(tmpColorLine);
tmpColorLine:=TColorLineTool.Create(Self);
tmpColorLine.Axis:=Chart1.Axes.Left;
tmpColorLine.Value:=400;
tmpColorLine.Pen.Color:=clBlack;
tmpColorLine.Pen.Width:=2;
Chart1.Tools.Add(tmpColorLine);
end;
Unless I'm mistaken, I don't think this should be happening. Please advise.
Thanks
Scott