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
40
UltraDataChart Scrolling Time Axis
posted

I have a UltraDataChart with a CategoryDateTimeXAxis and a NumericYAxis.  I need a scrolling window of view-able time on the chart.  How can I show only the last 5 minutes of data in the chart's view-able area, but be able to pan and see the points which are outside the 5 minute window?

Parents
No Data
Reply
  • 7695
    Verified Answer
    Offline posted

    Hi Jared,

        This is do-able, essentially what you will need to do is set the ultraDataChart1.HorizontalZoomable = true, and possibly the VerticalZoomable = true, if that is your desired viewstyle. Then you will need to set the WindowRect to show a viewport to that of your last 5 minutes. The biggest difficulty will be around the math of calculating the size of that WindowsRect. That difficulty will compound if you are on a constant live feed, that maintains it's entire history. This is because the WindowRect is essentially percentage of the whole. IE, If you want to show the whole chart the WindowRect will have a position of X=0, Y=0, Width=1, Height=1.
    But if you have a history of 50 minutes, and only want to show the last 5 minutes, for it's full height. You would have a X=.9, Y=0, Width=.1, Height=1.
    You may also want to look into the WindowRectMinWidth property to keep people zooming closer than 5 minutes.
    To assist with the calculations each axis has a GetScaledValue and GetUnscaledValue method. An example of it's use in a similar scenario can be found here:

    http://www.infragistics.com/community/forums/t/103200.aspx

    Let me know if that helps,

Children