How to display live data (a plot that updates itself) using WPF
See original GitHub issuehi, 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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like it is a duplicate of #905
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