using OxyPlot; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core; namespace Tango.DispenserAnalyzer.UI.Analysis { public class AnalyzerResultChartData : ExtendedObject { public ObservableCollection Points { get; set; } public string Title { get; set; } private int _step; public int XStep { get { return _step; } set { _step = value; RaisePropertyChangedAuto(); } } private double _fromXAxis; public double FromXAxis { get { return _fromXAxis; } set { _fromXAxis = value; RaisePropertyChangedAuto(); } } private double _toXAxis; public double ToXAxis { get { return _toXAxis; } set { _toXAxis = value; RaisePropertyChangedAuto(); } } private double _fromYAxis; public double FromYAxis { get { return _fromYAxis; } set { _fromYAxis = value; RaisePropertyChangedAuto(); } } private double _toYAxis; public double ToYAxis { get { return _toYAxis; } set { _toYAxis = value; RaisePropertyChangedAuto(); } } public void UpdateData() { _toYAxis = Points.Max(x => x.Y) + 2; _fromYAxis = Points.Min(x => x.Y) - 1; _toXAxis = Points.Max(x => x.X); _fromXAxis = Points.Min(x => x.X); RaisePropertyChanged("Title"); RaisePropertyChanged("Points"); } public AnalyzerResultChartData() { Points = new ObservableCollection(); _fromYAxis = 0; _fromXAxis = 0; _toYAxis = 1; _toXAxis = 1; XStep = 1; } } }