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
215
Binding to live incoming data with one value at a time.
posted

I'm working on a small project to bind to live data.  The data I'm using comes in one point at a time once per second.  I don't store the values throughout time but would like to have them added to a chart as they come in (like how processor usage is shown in the Task Manager).  I have tested the class by binding it to a label and I can see it changing every second.  Do I need to create an additional class to collect these values into a list and then bind the chart to that list, or is it possible to bind directly to a chart and it will collect the values?

Also, I'm trying to complete the binding in XAML only.

Parents
  • 34510
    Verified Answer
    Offline posted

    Hi Joshua,

    Usually the best way to do this would be to create a collection for your data and then bind this collection to the ItemsSource property on the Series.  Then when your data comes in, you can add it to the collection which will automatically update the Series to reflect this.  This binding can be done just once when the xamDataChart is created and then you won't need to worry about the binding anymore.

Reply Children