So here it is:
procedure TForm1.ChartToolset1DataPointDragTool1Drag( ASender: TDataPointDragTool; var AGraphPoint: TDoublePoint);
var
p: TNearestPointParams;
r: TNearestPointResults;
begin
p.FDistFunc := @PointDistX;
p.FOptimizeX := true;
p.FPoint := Chart1.GraphToImage(AGraphPoint);
p.FRadius := 15;
Cursor1.SetYValue(0,7);
if Wavedata.GetNearestPoint(p, r) then AGraphPoint := Wavedata.AxisToGraph(r.FValue);
Cursor1.SetText(0,'U='+ FloatToStrF(Cursor1.GetYValue(0),ffFixed,3,3) + ' V') ; //Comment this line, if you are using Lazarus build less than 38732.
Label2.Caption:= FloatToStrf(Cursor1.GetYValue(0),ffFixed,3,3) + ' ' + FloatToStrf(Cursor2.GetYValue(0),ffFixed,3,3);
end;
If the code is run this way, both label2.caption and the cursor caption show „7“.
But if I do Cursor1.GetYValue(0) in a procedure run after procedure TForm1.ChartToolset1DataPointDragTool1Drag( ASender: TDataPointDragTool; var AGraphPoint: TDoublePoint); then I get the exact Y value.
If I get you right, the idea is that the behaviour shall be exactly this?
Couldn't and shouldn't running AGraphPoint := Wavedata.AxisToGraph(r.FValue); change the result of GetYValue immediately, instead of waiting the whole procedure to finish? Or probably the concept is that with the current implementation the designer will know both the values in the beginning and during the execution process (current value) of the procedure. It is sure, that breaking compatibility with Delphi is unwanted.