FastGraphWPF 1.0.9
dotnet add package FastGraphWPF --version 1.0.9
NuGet\Install-Package FastGraphWPF -Version 1.0.9
<PackageReference Include="FastGraphWPF" Version="1.0.9" />
<PackageVersion Include="FastGraphWPF" Version="1.0.9" />
<PackageReference Include="FastGraphWPF" />
paket add FastGraphWPF --version 1.0.9
#r "nuget: FastGraphWPF, 1.0.9"
#:package FastGraphWPF@1.0.9
#addin nuget:?package=FastGraphWPF&version=1.0.9
#tool nuget:?package=FastGraphWPF&version=1.0.9
using CommunityToolkit.Mvvm.ComponentModel; using FastGraphWPF.Interface; using FastGraphWPF.Models; using System.Collections.ObjectModel; using System.Timers;
namespace FastGraphWPF { public partial class MainWindowVM : ObservableObject { private readonly System.Timers.Timer _pollTimer = new System.Timers.Timer(1000); private double _time = 0; private readonly Random _random = new Random();
private GraphRenderer _renderer = new GraphRenderer();
private FastGraph _fastGraph;
[ObservableProperty]
public ObservableCollection<IDataSeries> series = new ObservableCollection<IDataSeries>();
[ObservableProperty]
public string title = "123";
[ObservableProperty]
public bool autoUpdate = false;
public MainWindowVM(FastGraph fastGraph)
{
_fastGraph = fastGraph;
Series.Add(new DataSeries("1", System.Windows.Media.Colors.Red, 1.0));
Series.Add(new DataSeries("2", System.Windows.Media.Colors.Blue, 1.0));
Series.Add(new DataSeries("3", System.Windows.Media.Colors.Green, 1.0));
_pollTimer.Elapsed += Timer_Tick;
_pollTimer.Start();
}
public int rrr = 0;
private void Timer_Tick(object sender, ElapsedEventArgs e)
{
System.Windows.Application.Current.Dispatcher.Invoke(() =>
{
AddNewPoint();
_fastGraph.UpdateGraph();
if (rrr == 10)
{
SaveGraph(800, 600);
rrr = 0;
}
});
rrr++;
}
private void AddNewPoint()
{
_time += 0.5;
Series[0].AddPoint(_time, 0);
Series[1].AddPoint(_time, 0 + 1);
Series[2].AddPoint(_time, 0 + 0.5);
}
public void SaveGraph(double width, double height)
{
string filePath = System.IO.Path.GetFullPath($"123.jpg");
_renderer.ExportToJpeg(Series, width, height, filePath, 90);
}
}
}
<Window x:Class="FastGraphWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FastGraphWPF" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <local:FastGraph x:Name="Graph" Series="{Binding Series}" Title="{Binding Title}" UnitValue="" UnitTime="s" IsAutoUpdateEnabled ="{Binding AutoUpdate}"/> </Grid> </Window>
using System.Windows;
namespace FastGraphWPF { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window {
public MainWindow()
{
InitializeComponent();
MainWindowVM mainWindowVM = new MainWindowVM(Graph);
DataContext = mainWindowVM;
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net9.0-windows7.0 is compatible. net10.0-windows was computed. |
-
net8.0-windows7.0
- No dependencies.
-
net9.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.