Is it possible to use ScottPlot with Data Binding on plottables?
See original GitHub issueI couldn’t find anywhere if it is possible.
I’ve used Syncfusion SfChart before, and it is possible to bind the the chart with it’s series collection, for exemple:
<chart:SfChart x:Name="SfChart1" Series="{Binding SeriesCollection}" >
Thant would be amazing to do something similar with ScottPlot, so whenever I update a plottable, the chart updates.
<WpfPlot Name="wpfPlot1" Plottables={Binding PlottablesCollection} />
Also, if there is any material about using ScottPlot with mvvm pattern, I would appreciate.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ScottPlot does not plot when data template is used
1 Answer. Scott Plot is not implemented as a proper WPF control that supports data-binding and MVVM.
Read more >Plot Data with ScottPlot
ScottPlot is a free and open-source interactive plotting library for .NET. It has user controls for Windows Forms, WPF, Avalonia, ...
Read more >Data wrangling and visualization in the tidyverse
Use summarize , group_by , and tally to split a data frame into groups of ... Use the ggplot() function and bind the...
Read more >sas.plottools package — SasView 3.0.0 documentation
Our solution is to provide parametric styles, in which a number of different classes of object (e.g., reflectometry data, reflectometry theory) representing ...
Read more >Plotly.NET Plotly.NET
CSharp , native C# bindings that make the usage of Plotly.NET more idiomatic from C#. This is work in progress. Missing charts and/or...
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
You can create WpfPlot in ViewModel:
and bind it in you view:
It’s bad pattern bring control to VM, but it should work.
https://github.com/swharden/ScottPlot/blob/master/src/ScottPlot.Demo.WPF/WpfDemos/LiveDataGrowing.xaml.cs
Hey @eduhza, thanks for raising this issue, and @StendProg for your insightful comments along the way.
@StendProg described the state of ScottPlot very well, and I’ll just add a couple comments for additional context.
MVVM pattern is very common in the .NET word (and is used by many .NET charting libraries, especially for WPF) but ScottPlot’s API was designed to mimic that of matplotlib (a very popular charting library for Python) which uses sequential method calls to load data with numerous optional arguments for style customization.
ScottPlot was designed to make it as easy as possible to create plots from console applications (with WinForms and WPF controls provided as lite wrappers to provide interactivity in GUI environments). As @StendProg noted, adapting it to fit MVVM would be pretty difficult to do well. The best way to go, for now, is for the programmer to control data updates and rendering manually.
@eduhza if you have more questions along the way let us know! Similarly, if your tests reveal interesting findings feel free to share them here. I’ll close this issue for now, but thanks again for opening it initially.