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
725
How to get the X, Y coordinates where a ScatterLineSeries leaves the viewport.
posted

Please see the attached picture it say more than my words. I would like to get the X,Y coordinates the points at top and right where a ScatterLineSerie leaves (enters) the viewport. (I am not sure I am using the term viewport correctly). Please note that in the picture that is _one_ line series so it has multiple points to get.

I plan to catch some event (please recommend) when the zoom or the pan are changing then get the actual collection the X, Y coordinates. 

I strongly hope this is possible, because this on of the requirement of my project to display labels there. (I do know how to position a UI element if I know the X,Y)

Picture: http://screencast.com/t/09wwYO2k9r

Thanks in advance

Point to get their X,Y coordinates


Parents
  • 34430
    Offline posted

    Hello Justin,

    Thank you for your post. The event that I would recommend handling to achieve this functionality is the ActualWindowRectChanged event of the XamDataChart. In this event handler, I would recommend getting the axes that you are using in the XamDataChart to determine the viewport and it will also help to get the unscaled values of the maximum and minimum x and y values.

    You will also need the WindowRect for the following, which you can get using XamDataChart1.WindowRect. To determine the min and max visible x and y values, you will need to use the GetUnscaledValue method on the axes. After you get these values, you will need a collection to hold the visible points on your scatter line series. You can do this by looping through your ItemsSource collection and comparing the min and max visible x and y values to each point in your ItemsSource. If the values are between these visible values, create a Point for it, and add it to a new collection of type Point.

    After that, you can find the highest and lowest values in that collection and set them to a point value, which you can display.

    I have attached a sample application that demonstrates the above using three scatter line series.

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

    Sincerely,
    Andrew
    Developer Support Engineer I
    Infragistics Inc.
    www.infragistics.com/support

    XamDataChartEndOfViewPortCase.zip
Reply Children