Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1105031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:34:05+00:00 2026-05-17T01:34:05+00:00

How do you update a WPF chart when the collection changes? I am using

  • 0

How do you update a WPF chart when the collection changes? I am using WPF chart (System.Windows.Controls.DataVisualization.Toolkit.dllversion version 3.5.50211.1) to plot some simple data. The classes for the data look like this:

public class EngineMeasurementCollection : Collection<EngineMeasurement> 
{ 

} 
public class EngineMeasurement 
{ 
    public int TimeStamp { get; set;}
    public int Speed { get; set; } 
    public int Torque { get; set; } 
    public int Power { get; set; } 
}  

In my Mainform, I am receiving new data on an event callback. This comes back on another thread. I look at the data to see if it has a new TimeStamp. If it is, I add it to my collection. I then dutifully call

Dispatcher.Invoke(myDelegate, DispatcherPriority.Normal,null) 

to get myself back on the GUI thread. I then call:

m_ctrlLineSeriesTorque.ItemsSource = m_TorqueCollection; 

to try and get the chart to update. I’ve verified I get into this code. I’ve also verified that I can display a chart if I just throw some values into the contructor of EngineMeasurementCollection. How do I get the chart to update as I add more values to the collection?

Somewhere I saw that there might be a “Refresh” method on the chart itself. I don’t see that. Also, I saw that perhaps EngineMeasurementCollection should be an “Observable collection” and EngineMeasurement should implement some interface. True?

Thanks,
Dave

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:34:06+00:00Added an answer on May 17, 2026 at 1:34 am

    Yes, your EngineMeasurmentCollection should be an ObservableCollection. Then you won’t have anything more to do but add (or remove) items to the collection and the WPF binding system will take care of the rest to update the chart. That’s the reason you should use an observable collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using WPF, and VB.net, I want to update a textbox in a textblock with
I've a WPF toolkit chart which I want to be able to both specify
How can you dynamically update the datasource of a WPF ToolKit chartcontrol? In the
I'm passing IEnumerable Collection into WPF DataGrid through DataGrid.ItemSource property. But it doesn't update
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
Hi I'm trying to update a line chart every second (from the wpf data
for automatic update of my WPF application, I've this strategy : (1) process.exe starts
Update 2018 TL;DR; LaTEX for WPF https://github.com/ForNeVeR/wpf-math Original question I need to have a
In a multi-threaded WPF application, it is not possible to update an ObservableCollection from
I have a WPF application implemented using the MVVM framework that uses an ActiveX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.