diff --git a/View/ProductionPlanningView.xaml b/View/ProductionPlanningView.xaml index 80b4b1c..27a71bf 100644 --- a/View/ProductionPlanningView.xaml +++ b/View/ProductionPlanningView.xaml @@ -6,10 +6,12 @@ xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View" xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels" - xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:planner="http://mindfusion.eu/scheduling/wpf" - mc:Ignorable="d" Loaded="UserControl_Loaded" - d:DesignHeight="630" d:DesignWidth="1280"> + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" + xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel" + d:DataContext="{d:DesignInstance Type=viewmodel:ProductionPlanningModel}" + mc:Ignorable="d" Loaded="UserControl_Loaded" + d:DesignHeight="630" d:DesignWidth="1280"> @@ -18,10 +20,14 @@ - - - - + + + + + + + + diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index ff42316..6ed74da 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -29,6 +29,7 @@ using System.Xml.Linq; using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep; using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using SunlightCentralizedControlManagement_SCCM_.ViewModel; namespace SunlightCentralizedControlManagement_SCCM_.View { @@ -40,6 +41,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View public ProductionPlanningView() { InitializeComponent(); + DataContext = new ProductionPlanningModel(); } private SQLiteHelper SQLiteHelpers = null; //定义数据库 @@ -47,15 +49,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作 { - - - - - - - - - + } private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件 diff --git a/ViewModel/CurveDiagramViewModel.cs b/ViewModel/CurveDiagramViewModel.cs index bd5285d..3bce235 100644 --- a/ViewModel/CurveDiagramViewModel.cs +++ b/ViewModel/CurveDiagramViewModel.cs @@ -199,8 +199,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel } Series = new ISeries[] - { - new LineSeries + { + new LineSeries { Name = Properties.Resources.MasterCylinder +"PH", Values = MTH_values, diff --git a/ViewModel/ProductionPlanningModel.cs b/ViewModel/ProductionPlanningModel.cs index 5980c12..247d9ed 100644 --- a/ViewModel/ProductionPlanningModel.cs +++ b/ViewModel/ProductionPlanningModel.cs @@ -31,7 +31,50 @@ using SunlightCentralizedControlManagement_SCCM_.View; namespace SunlightCentralizedControlManagement_SCCM_.ViewModel { public partial class ProductionPlanningModel : ObservableObject//ViewModelBase - { - + { + public ISeries[] Series { get; set; } + public Axis[] XAxes { get; set; } = + { + new DateTimeAxis(TimeSpan.FromSeconds(5) , date => date.ToString("yyyy-MM-dd HH:mm")) + { + CrosshairLabelsBackground = SKColors.DarkGray.AsLvcColor(), + CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkSlateBlue, 1), + CrosshairPaint = new SolidColorPaint(SKColors.DarkSlateGray, 1), + }, + }; + + public ProductionPlanningModel() + { + Series = new ISeries[] + { + new RowSeries + { + Values = new List { 3 }, + Stroke = null, + DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)), + DataLabelsSize = 14, + DataLabelsPosition = DataLabelsPosition.Middle + }, + new RowSeries + { + Values = new List { 4}, + Stroke = null, + DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)), + DataLabelsSize = 14, + DataLabelsPosition = DataLabelsPosition.Middle + }, + new RowSeries + { + Values = new List { -2 }, + Stroke = null, + DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)), + DataLabelsSize = 14, + DataLabelsPosition = DataLabelsPosition.Middle + } }; + + + + } + } }