1

How to get the value corresponding to the position of the mouse cursor on the curve now?

I tried GetHorizAxis.LabelValue, but it just get the value where the mouse position is.

thanks.

Lin Andy
  • 11
  • 1

1 Answers1

1

Use XScreenToValue for needed Series to convert coordinate into the value at the corresponding axis:

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Caption := FloatToStr(Series1.XScreenToValue(X));
end;
MBo
  • 77,366
  • 5
  • 53
  • 86