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

  • Home
  • SEARCH
  • 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 3324236
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:23:51+00:00 2026-05-17T23:23:51+00:00

In a WPF Window, I’ve got a line chart that plots real-time data (Quinn-Curtis

  • 0

In a WPF Window, I’ve got a line chart that plots real-time data (Quinn-Curtis RealTime chart for WPF). In short, for each new value, I call a SetCurrentValue(x, y) method, and then the UpdateDraw() method to update the chart.

The data comes in via a TCP connection in another thread. Every new value that comes in causes an DataReceived event, and its handler should plot the value to the chart and then update it. Logically, I can’t call UpdateDraw() directly, since my chart is in the UI thread which is not the same thread as where the data comes in.

So I call Dispatcher.Invoke( new Action (UpdateDraw()) ) – and this works fine, well, as long as I update max. 30 times/sec. When updating more often, the Dispatcher can’t keep up and the chart updated slower than the data comes in. I tested this using a single-thread situation with simulated data and without the Dispatcher there are no problems.

So, my conclusion is that the Dispatcher is too slow for this situation. I actually need to update 100-200 times/sec!

Is there a way to put a turbo on the Dispatcher, or are there other ways to solve this? Any suggestions are welcome.

  • 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-17T23:23:52+00:00Added an answer on May 17, 2026 at 11:23 pm

    An option would be to use a shared queue to communicate the data.

    Where the data comes on, you push the data to the end of the queue:

    lock (sharedQueue)
    {
        sharedQueue.Enqueue(data);
    }
    

    On the UI thread, you find a way to read this data, e.g. using a timer:

    var incomingData = new List<DataObject>();
    
    lock (sharedQueue)
    {
        while (sharedQueue.Count > 0)
            incomingData.Add(sharedQueue.Dequeue());
    }
    
    // Use the data in the incomingData list to plot.
    

    The idea here is that you’re not communicating that data is coming in. Because you have a constant stream of data, I suspect that’s not a problem. I’m not saying that the exact implementation as give above is the rest, but this is about the general idea.

    I’m not sure how you should check for new data, because I do not have enough insight into the details of the application; but this may be a start for you.

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

Sidebar

Related Questions

I want to make a WPF Window that behaves like a context menu. So,
I have a wpf window that has a height of 2000 with an actual
I have a WPF window that uses validation. I created an error template that
I have a WPF Window that contains a TextBox. I have implemented a Command
I have a WPF window that has TopMost=true . When I call another Window
I have a WPF Window which has a among other controls hosts a Frame.
I have a WPF window for editing database information, which is represented using an
Is it possible to have a WPF window/element detect the drag'n'dropping of a file
If I use dragMove the wpf window will not move to a location where
Is it possible to find out whether WPF Window is loaded? I have a

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.