public void AddPoint(double y) { if (pointCount == pointLimit) { // shift all points to the left for (int i = 0; i < pointCount - 1; i++) { MyDataSeries.Points[i] = new OxyPlot.DataPoint(i, MyDataSeries.Points[i + 1].Y); } MyDataSeries.Points[pointCount - 1] = new OxyPlot.DataPoint(pointCount - 1, y); } else { MyDataSeries.Points.Add(new OxyPlot.DataPoint(pointCount, y)); } if (pointCount < pointLimit) { pointCount++; } // check range limits if (y > maxValue) { maxValue = y; MyYAxis.Maximum = maxValue * 1.1; } MyPlotModel.InvalidatePlot(true); }
public void ResetPlot() { MyDataSeries.Points.Clear(); pointCount = 0; maxValue = 1.5; MyYAxis.Maximum = maxValue; MyPlotModel.InvalidatePlot(true); }
private async Task PlotLine(Tag tag) { SelectedTag = tag; await _plotModelHelper.PlotTagOnLinePlotModel(MyPlotModel, SelectedTag, Settings); RaisePropertyChanged(nameof(MyPlotModel)); MyPlotModel.InvalidatePlot(true); }
private async Task PlotLine(Tag tag, List <Zone> zones) { SelectedTag = tag; MyPlotModel = await _plotModelHelper.PlotTagOnLinePlotModel(MyPlotModel, SelectedTag, Settings); MyPlotModel = await _plotModelHelper.ClearTextAnnotations(MyPlotModel); foreach (var zone in zones) { MyPlotModel = await _plotModelHelper.AddLineSeriesToPlot(MyPlotModel, zone.Points, zone.SelectedColor, zone.TextAnnotation); } RaisePropertyChanged(nameof(MyPlotModel)); MyPlotModel.InvalidatePlot(true); }
private void DrawProfiles() { foreach (var profile_current in profile_list) { LineSeries series = new LineSeries { Title = $"{profile_current.FieldX} - {profile_current.Depth}" }; foreach (var point in profile_current.DataPoints) { series.Points.Add(new OxyPlot.DataPoint(point.Position, point.Value)); } MyPlotModel.Series.Add(series); } MyPlotModel.InvalidatePlot(true); }
public void PlotGraph(List <Tuple <double, double> > coordinates, string header = "Нейтрон") { var xyeta = Points; foreach (var item in TupleToDataPoint(coordinates)) { xyeta.Add(item); } var series = new LineSeries(); series.ItemsSource = xyeta; MyPlotModel.Series.Add(series); MyPlotModel.InvalidatePlot(true); //OnPropertyChanged(nameof(Points)); //Points = xyeta; Title = header; }
private async void PlotZone(Zone zone) { var firstOrDefault = _zones.FirstOrDefault(x => x.ZoneId == zone.ZoneId); if (firstOrDefault != null) { _zones.Remove(firstOrDefault); } if (!string.IsNullOrEmpty(zone.PointsInText)) { _zones.Add(zone); } if (SelectedTag == null) { return; } await PlotLine(SelectedTag, _zones); RaisePropertyChanged(nameof(MyPlotModel)); MyPlotModel.InvalidatePlot(true); }