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
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,AndrewDeveloper Support Engineer IInfragistics Inc.www.infragistics.com/support
Hi Andrew
Thanks for your work, I tried. Unfortunately I can not use your solution for my case because of 2 reasons:
1) Your algorithm collects the visible points of a scatterlineserie. Please note that the serie line is visible between the serie points also. In my case (in the pic I've attached in my original question), there are no points in the viewable rectangle at all, of course the line is drawn between that points, so we are viewing the line. (not the points)
2) The pic I've attached that is _one_ line just crosses the rectangle more. It is possible for _one_ scatterline to move out and in to the rectangle. Imagine a simple zigzag a bit zoomed in.
Now I would like to get _all_ points coordinates where the drawed line leaves the rectange at a) top b) right.
Thanks in advance.