Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
CursorPosition in CrosshairLayer not over data point if zoomed
posted

Hi,

I have a binding for CursorPosition in CrosshairLayer:

<Setter Property="CursorPosition" Value="{Binding DataCursorPosition, Mode=OneWay}" />

If I change the zoom it is placed not over data point, if not zoomed works fine.
updating cursor cursor in ViewModel:
DataCursorPosition = (double)(dataPoint.Time.Ticks - minTime.Ticks) / (maxTime.Ticks - minTime.Ticks); 
Best regards,
Krzysztof
Parents
  • 34810
    Offline posted

    Hello Krzysztof,

    I have been investigating into the behavior you are seeing, but I cannot seem to reproduce the behavior where zooming does not place the CrosshairLayer on the data point. One thing that may be a problem with the code you are using in this case though, is that the CursorPosition property take a Point object – not a double, and so I’m not sure that your binding to DataCursorPosition will work in this case unless you are converting it somehow?

    I am attaching the sample project I used to test this. In the sample, the crosshair stays locked to the data point I have defined and am calculating the position of.

    Please let me know if you have any other questions or concerns on this matter.

    XamDataChartCrosshairPositionBinding.zip

Reply Children