From 7ba819258ff0b8f428c020947654aaeabacb7572 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=80=81=E4=B9=9D?= <366193849@qq.com>
Date: Fri, 29 Oct 2021 22:48:10 +0800
Subject: [PATCH] chart
---
FastGithub.UI/FastGithub.UI.csproj | 9 ++++++++
FastGithub.UI/LineChart.xaml | 19 ++++++++++++++++
FastGithub.UI/LineChart.xaml.cs | 35 ++++++++++++++++++++++++++++++
FastGithub.UI/packages.config | 5 +++++
4 files changed, 68 insertions(+)
create mode 100644 FastGithub.UI/LineChart.xaml
create mode 100644 FastGithub.UI/LineChart.xaml.cs
create mode 100644 FastGithub.UI/packages.config
diff --git a/FastGithub.UI/FastGithub.UI.csproj b/FastGithub.UI/FastGithub.UI.csproj
index 3b10cb3..820abf5 100644
--- a/FastGithub.UI/FastGithub.UI.csproj
+++ b/FastGithub.UI/FastGithub.UI.csproj
@@ -42,6 +42,14 @@
app.ico
+
+ ..\packages\LiveCharts.0.9.7\lib\net45\LiveCharts.dll
+ True
+
+
+ ..\packages\LiveCharts.Wpf.0.9.7\lib\net45\LiveCharts.Wpf.dll
+ True
+
@@ -94,6 +102,7 @@
Resources.Designer.cs
+
SettingsSingleFileGenerator
Settings.Designer.cs
diff --git a/FastGithub.UI/LineChart.xaml b/FastGithub.UI/LineChart.xaml
new file mode 100644
index 0000000..8537985
--- /dev/null
+++ b/FastGithub.UI/LineChart.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FastGithub.UI/LineChart.xaml.cs b/FastGithub.UI/LineChart.xaml.cs
new file mode 100644
index 0000000..2df5441
--- /dev/null
+++ b/FastGithub.UI/LineChart.xaml.cs
@@ -0,0 +1,35 @@
+using LiveCharts;
+using LiveCharts.Wpf;
+using System;
+using System.Windows.Controls;
+
+namespace FastGithub.UI
+{
+ ///
+ /// LineChart.xaml 的交互逻辑
+ ///
+ public partial class LineChart : UserControl
+ {
+ public SeriesCollection SeriesCollection { get; } = new SeriesCollection();
+
+ public string[] Labels { get; set; }
+
+ public Func YFormatter { get; set; }= value => value.ToString("0.00");
+
+ public LineSeries ReadSeries { get; } = new LineSeries();
+
+ public LineSeries WriteSeries { get; } = new LineSeries();
+
+ public LineChart()
+ {
+ InitializeComponent();
+
+ this.SeriesCollection.Add(this.ReadSeries);
+ this.SeriesCollection.Add(this.WriteSeries);
+
+ DataContext = this;
+ }
+
+
+ }
+}
diff --git a/FastGithub.UI/packages.config b/FastGithub.UI/packages.config
new file mode 100644
index 0000000..c9381c5
--- /dev/null
+++ b/FastGithub.UI/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file