Clipping problem with Chart1.Canvas.LineTo & AfterDrawVa
Posted: Tue Dec 19, 2006 8:04 pm
I have a pointer series on a chart, and I am drawing custom lines from certain points to others (not like the sequential point to point ones that are built in). The lines draw fine and scroll with the chart but they do not clip at the axis like the points in the series do. How can I get my custom lines to clip like the points in the series do?
Thanks in advance,
David
Code: Select all
procedure TForm1.Series1AfterDrawValues(Sender: TObject);
var x0, y0, x1, y1, x2, y2 : Integer ;
begin
Chart1.ClipPoints:=true;
x0:=Series1.CalcXPos(0);
y0:=Series1.CalcYPos(0);
x1:=Series1.CalcXPos(1);
y1:=Series1.CalcYPos(1);
x2:=Series1.CalcXPos(2);
y2:=Series1.CalcYPos(2);
Chart1.Canvas.MoveTo( x0, y0 );
Chart1.Canvas.LineTo( x1, y1 );
Chart1.Canvas.MoveTo( x0, y0 );
Chart1.Canvas.LineTo( x2, y2 );
end;
Thanks in advance,
David