Thanks for helping, but the angle of the GuideLine changes when it is extended. I cant find out why:
procedure TForm1.FormCreate(Sender: TObject);
begin
{ Some values for the GuideLine }
Pt1.X:=3;
Pt1.Y:=1.3;
Pt2.X:=6;
Pt2.Y:=1.65;
{ Populate GuideLine Series }
GuideLine.AddXY(Pt1.X, Pt1.Y);
GuideLine.AddXY(Pt2.X, Pt2.Y);
{ Populate Line Series, for comparison }
LineSeries.AddXY(1, 1);
LineSeries.AddXY(10, 2);
end;
procedure TForm1.btnExtendClick(Sender: TObject);
const
LAST_REC = 1;
begin
m := (Pt2.Y - Pt1.Y) / (Pt2.X - Pt1.X);
c := -m * (Pt2.X / Pt2.Y);
Pt2.X:= LineSeries.GetXMax;
Pt2.Y := m * Pt2.X + c;
GuideLine.SetXValue(LAST_REC, Pt2.X);
GuideLine.SetYValue(LAST_REC, Pt2.Y);
end;
@wp: The FitSeries extends as you said. So far I have used a TLineSeries that the user can resize and move around. Maybe it can be substituted with the FitSeries. But I'm anyway interested in how to do this with a TLineSeries.