49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||
|
|
using LiveChartsCore;
|
||
|
|
using LiveChartsCore.SkiaSharpView;
|
||
|
|
|
||
|
|
namespace WCTDataMiner.Wpf.ViewModels;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Qfod 折线图 ViewModel
|
||
|
|
/// </summary>
|
||
|
|
public partial class QfodChartViewModel : ObservableObject
|
||
|
|
{
|
||
|
|
[ObservableProperty]
|
||
|
|
private int _scenarioId;
|
||
|
|
|
||
|
|
[ObservableProperty]
|
||
|
|
private ISeries[] _series;
|
||
|
|
|
||
|
|
[ObservableProperty]
|
||
|
|
private Axis[] _xAxes;
|
||
|
|
|
||
|
|
[ObservableProperty]
|
||
|
|
private Axis[] _yAxes;
|
||
|
|
|
||
|
|
public QfodChartViewModel()
|
||
|
|
{
|
||
|
|
// 初始化图表配置
|
||
|
|
Series = Array.Empty<ISeries>();
|
||
|
|
XAxes = new Axis[] { new Axis { Name = "Coil Index" } };
|
||
|
|
YAxes = new Axis[] { new Axis { Name = "Q Value" } };
|
||
|
|
}
|
||
|
|
|
||
|
|
public async Task LoadDataAsync()
|
||
|
|
{
|
||
|
|
// TODO: 从数据库加载 Qfod 数据并构建图表
|
||
|
|
Series = new ISeries[]
|
||
|
|
{
|
||
|
|
new LineSeries<double>
|
||
|
|
{
|
||
|
|
Name = "DeltaQ",
|
||
|
|
Values = new double[] { 25, 30, 28 }
|
||
|
|
},
|
||
|
|
new LineSeries<double>
|
||
|
|
{
|
||
|
|
Name = "CurrentQ",
|
||
|
|
Values = new double[] { 45.5, 50.2, 48.8 }
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|