如果你是想要以注释的方式来显示的话,请参照下面程序。
procedure TfmOTDRData.ChartOTDRMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var tx,ty,px,py : Double ;
i : integer ;
begin
if Assigned(Series1) then begin
i := Series1.GetCursorValueIndex ; //获取点序号
if i >= 0 then begin
px := Series1.XValues; //获取X,Y值
py := Series1.YValue;
Series1.GetCursorValues(tx,ty); //获取鼠标位置
if (abs(tx-px)<=4)and (abs(ty-py)<=4)then begin //判断是否在点的位置
ChartOTDR.Hint := 'tx:'+FloatToStr(px)+',ty:'+FloatToStr(py); //产生注释信息
ChartOTDR.ShowHint := true ;
Application.ActivateHint(Point(X,Y));
end else ChartOTDR.ShowHint := false ; //不在点位时不显示注释
end;
end;
end;