-2

with MouseMove procedure, I can get X and Y pos. by this code:

///////////

var

  XVal: double;
  YVal: double;

begin

  XVal:=Chart1.Axes.Bottom.CalcPosPoint(X);
  YVal:=Chart1.Axes.Left.CalcPosPoint(Y);

  Chart1.Title.Text[0]:=FormatFloat('#.##', XVal) + ' - ' + FormatFloat('#.##', YVal);
end;

////////////

It's OK. But I would like get the X and Y coordinates of a series1.Value (single value, it is 'somewhere' on the chart) by clicking a (separate) button and not by moving the mouse above this value. Maybe it is a very simple question. Thanks.

Narcís Calvet
  • 7,304
  • 5
  • 27
  • 47

1 Answers1

2

You can use functions of series:

CalcXPos - to get screen X-coordinate by index of value (in serie) CalcXPosValue - to get screen X-coordinate by value

(CalcYPos/CalcYPosValue for Y-coordinate)

Andrei Galatyn
  • 3,322
  • 2
  • 24
  • 38