The way how I understand your question is that you want to draw a straight line between the mouse-down point and the current mouse position and display the slope of this curve.
The most complete, ready-to-use solution in TAChart for this job is with a TDataPointDistanceTool. It has all the drawing code built-in and displays a label along the connecting line between the starting and current mouse point. By default, the text in the label is the distance between the points, but there is an event "GetDistanceText" to taylor the text:
procedure TForm1.ChartToolset1DataPointDistanceTool1GetDistanceText(
ASender: TDataPointDistanceTool; var AText: String);
var
m: Double;
begin
with ASender do
if PointStart.GraphPos.X = PointEnd.GraphPos.X then
AText := 'Slope = Infinity'
else begin
m := (PointEnd.GraphPos.Y - PointStart.GraphPos.Y) /
(PointEnd.GraphPos.X - PointStart.GraphPos.X);
AText := Format('Slope = %f', [m]);
end;
end;
To have more formatting options for the slope label I'd recommend to set the DrawingMode of the tool to dmNormal. You may want to turn off the begin and end markers of the connecting line (PointerEnd.Visible := false, PointerStart.Visible := false). And to see the slope label after mouse-up activate the Option dpdoPermanent. And of course, you have to select the Shift parameters to show the tool, e.g. ssShift+ssLeft for the Shift key together with mouse-down.
After that, TAChart does all the rest...