Jump to content
Software FX Community

How to get a fixed sliding time-window when displaying Real-Time data?


daniel.lishingman
 Share

Recommended Posts

I'm binding an instance of the Observable<T> class (let's call it myCol) to the chart in a WPF application.  The x-axis has time and the x-axis is an unsigned integer.  At runtime, myCol starts with zero items and I add a new item every second up to 100 items.  When 100 is reached, the oldest item is deleted from myCol.

 With the Chart's default behavior, the first time on the x-axis stays fixed at the time of the first item.  As new items are added, the time scale on the x-axis becomes compressed as the last time on the axis increases with each new item added.  The behavior I would like to have is that the time on the axis is fixed to something I specify (say 5-minutes), and this "fixed window" slides forward as new items are added. 

 I tried setting the min/max properties of the Axis class but I can't figure out its values (double type) correspond to Date/Times.  Can someone show me some sample code for how to achieve this?

Thanks!

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...