diff --git a/BPASmartClient.Academy/App.xaml b/BPASmartClient.Academy/App.xaml
index 28a1ac94..8c2f9beb 100644
--- a/BPASmartClient.Academy/App.xaml
+++ b/BPASmartClient.Academy/App.xaml
@@ -20,6 +20,7 @@
+
diff --git a/BPASmartClient.Academy/ColorResource.xaml b/BPASmartClient.Academy/ColorResource.xaml
index 83c639af..0dc1783a 100644
--- a/BPASmartClient.Academy/ColorResource.xaml
+++ b/BPASmartClient.Academy/ColorResource.xaml
@@ -1,3 +1,10 @@
- yellow
+ #ff0000
+ #90ee90
+ #00bfff
+ #ffff00
+ #ffa500
+ #9b30ff
+ #00ffff
+ #ff00ff
\ No newline at end of file
diff --git a/BPASmartClient.Academy/View/HistoryChart50LView.xaml b/BPASmartClient.Academy/View/HistoryChart50LView.xaml
index 9c969e51..a89a61a8 100644
--- a/BPASmartClient.Academy/View/HistoryChart50LView.xaml
+++ b/BPASmartClient.Academy/View/HistoryChart50LView.xaml
@@ -327,7 +327,7 @@
CommandParameter="0"
Content="反应釜温度"
FontSize="14"
- Foreground="Red"
+ Foreground="{StaticResource 反应釜温度}"
IsChecked="{Binding VisStatus[0]}"
IsEnabled="{Binding IsEnable}" />
diff --git a/BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs b/BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs
index ae68be59..abd33e26 100644
--- a/BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs
+++ b/BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs
@@ -14,6 +14,7 @@ using ThingsGateway.Foundation.Extension.Generic;
using static System.Windows.Forms.LinkLabel;
using System.Windows;
using System.Windows.Media;
+using OxyPlot.Wpf;
namespace BPASmartClient.Academy.ViewModel
{
@@ -60,14 +61,14 @@ namespace BPASmartClient.Academy.ViewModel
OxyModel.Series.Clear();
OxyDataModels.Clear();
OxyModel = new PlotModel() { Title = num };
- OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜温度", OxyColor.Parse("#ff0000"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜蒸汽压力", OxyColor.Parse("#90ee90"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜蒸汽流量", OxyColor.Parse("#00bfff"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("冷凝水罐温度", OxyColor.Parse("#ffff00"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("冷凝水罐湿度", OxyColor.Parse("#ffa500"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("负压流量", OxyColor.Parse("#9b30ff"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("称重水罐重量", OxyColor.Parse("#00ffff"))));
- OxyDataModels.Add(new OxyDataModel(CreateLine("比例阀实际开度", OxyColor.Parse("#ff00ff"))));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜温度")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜蒸汽压力")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("反应釜蒸汽流量")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("冷凝水罐温度")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("冷凝水罐湿度")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("负压流量")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("称重水罐重量")));
+ OxyDataModels.Add(new OxyDataModel(CreateLine("比例阀实际开度")));
SqliteOperate.GetInstance.QueryableByNum(num).ForEach(item =>
{
@@ -104,13 +105,15 @@ namespace BPASmartClient.Academy.ViewModel
}
}
- private LineSeries CreateLine(string title, OxyColor fillColor)
+ private LineSeries CreateLine(string title)
{
+ var scb = Application.Current.TryFindResource(title) as SolidColorBrush;
+ scb.ToOxyColor();
return new LineSeries()
{
LineStyle = LineStyle.Solid,
Title = title,
- MarkerFill = fillColor,
+ MarkerFill = scb.ToOxyColor(),
MarkerSize = 2,
LineLegendPosition = LineLegendPosition.End
};