Drawline tool
Posted: Wed Jul 20, 2005 6:50 pm
I would like to add a drawline with marks on the line acting as a ruler. Is there a way to get at the ondraw event of a drawline tool and add a scale there?
thanks
Sean.
thanks
Sean.
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var i : integer;
begin
if Charttool1.Lines.Count > 0 then
for i := 0 to ChartTool1.Lines.Count -1 do
begin
Chart1.Canvas.TextOut(Chart1.Axes.Bottom.CalcXPosValue(Round(ChartTool1.Lines.Line[i].X0)),
Chart1.Axes.Left.CalcYPosValue(Round(ChartTool1.Lines.Line[i].Y0)),'0');
Chart1.Canvas.TextOut(Chart1.Axes.Bottom.CalcXPosValue(Round(ChartTool1.Lines.Line[i].X1)),
Chart1.Axes.Left.CalcYPosValue(Round(ChartTool1.Lines.Line[i].Y1)),'1');
end;
end;