question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to display live data (a plot that updates itself) using WPF

See original GitHub issue

hi, I have an application that updates the ScottPlot WPF object every time when an event happens. the problem is that I have to click on the graph in order to see the updated graph. is there any way to make the graph refresh itself without the click on the graph by the user? thanks! this is the updating code:

                    graph1.Plot.Clear();
                    graph2.Plot.Clear();
                    int len = vm_graphs.VM_Line;
                    double[] arr = new double[len];
                    double[] arr1 = new double[len];
                    double[] arr2 = new double[len];
                    vm_graphs.VM_LineList.GetRange(0,vm_graphs.VM_Line).ToArray().CopyTo(arr, 0);
                    vm_graphs.VM_FullValuesArray.GetRange(0, vm_graphs.VM_Line).ToArray().CopyTo(arr1, 0);
                    vm_graphs.VM_FullCorellativeValuesArray.GetRange(0, vm_graphs.VM_Line).ToArray().CopyTo(arr2, 0);
                    graph2.Plot.AddScatter(arr, arr2);
                    graph1.Plot.AddScatter(arr, arr1);
                    graph1.Plot.AxisAuto();
                    graph2.Plot.AxisAuto();
                    graph1.Plot.Render();
                    graph2.Plot.Render();

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FoggyFindercommented, Mar 28, 2021

Seems like it is a duplicate of #905

0reactions
swhardencommented, Mar 28, 2021

Hi @roycirkin,

I notice your render code is in a try/catch block. Is there a chance it is throwing an exception and exiting the block before Render() is called?

Downloadable examples of live, updating data plots can be found on https://swharden.com/scottplot/faq/live-data/

Hope it helps! Scott

Read more comments on GitHub >

github_iconTop Results From Across the Web

Efficient way to update Dynamic Data Display charts in WPF
I am currently creating a project which wil grab live data from a COM port for me and then display it for easy...
Read more >
Graphics rendering overview - WPF .NET Framework
Learn about the role of the basic graphics rendering class from which every object derives in the Windows Presentation Foundation (WPF).
Read more >
Solved: Wpf graph can't auto refresh - NI Community
I put 9 plots in a WPF graph and hoped to refresh the Plots[0] at ... to the list of data collections will...
Read more >
Realtime and Auto Updating Plot in C# - YouTube
Full source code available on https://k-sience.blogspot.com/2020/12/auto- updating - plot - in -c.html. Thank you for watching.
Read more >
Data Chart Component – WPF | Ultimate UI
This chart will display millions of data points and update itself every few milliseconds to handle your real-time feeds. Real-Time Charting with Millions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found