accessing crosshair x-axis values

I have used the "GetChartPointAtCrossHair" in the onMouseMove handler to get y-axis values from one or more series. How can I get get the x-axis value?

Hi,

This can be done by using the following code

  AdvChartView1.Panes[0].Series[0].XToValue(X, AdvChartView1.Panes[0].Series.SeriesRectangle);

X being the coordinate

Pieter,
Thanks for the followup. I was not able to use your solution. I assumed the context of the included code was the MouseMoveevent handler. The value returned by XToValue appears to be the y-axis coordinate and not the desired x-axis coordinate. Perhaps I am doing something wrong. Nevertheless, I was able to get the desired x-axis value another way. I created an array of my x-axis values and used the GetCrossHairValue event handler's ACrosshairPoint.Point to provide an index to reference my desired x-axis value from the array:

if (ACrosshairPoint.Point >= 0) AND (ACrosshairPoint.Point < Length(arrayname)) then begin
lblHeatNo.Caption := arrayname[ACrosshairPoint.Point];
end;

Thank you for the help.

1 Like

Thanks for the feedback!