//static int labelCounter = 0; private void AddValuesToPlotData(PlotData[] plotData) { if (!_HoldOn) { ClearPlot(); } var customLabel = CustomPlotLabel.Length > 0 ? "[" + CustomPlotLabel + "] " : ""; foreach (var t in plotData) { var points = t.Points; var title = customLabel + t.Title; Labels.Add(title + customLabel); DataSeriesCollection.Add(new DataPointCollection { DataPoints = points, Title = title, ColorTag = "ColorTag" }); //if (DataSeriesCollection.Count > 0 && points[0] is ComplexDataPoint) //{ // RealLabels.Add(title + "\r(real)" + customLabel); // PhaseLabels.Add(title + "\r(phase)" + customLabel); // ImagLabels.Add(title + "\r(imag)" + customLabel); // AmplitudeLabels.Add(title + "\r(amp)" + customLabel); //} //else //{ // Labels.Add(title + customLabel); // has to happen before updating the bound collection //} } PlotTitles.Add(Title); UpdatePlotSeries(); }
private void ClearPlotSingle() { if (DataSeriesCollection.Any()) { DataSeriesCollection.RemoveAt(DataSeriesCollection.Count - 1); //Clear the PlotSeriesCollection, it will be recreated with the plot PlotSeriesCollection.Clear(); Labels.RemoveAt(Labels.Count - 1); PlotTitles.RemoveAt(PlotTitles.Count - 1); PlotModel.Title = ""; } }
private void ClearPlot() { DataSeriesCollection.Clear(); PlotSeriesCollection.Clear(); Labels.Clear(); PlotTitles.Clear(); PlotModel.Title = ""; foreach (var axis in PlotModel.Axes) { axis.Reset(); } }
//static int labelCounter = 0; private void AddValuesToPlotData(PlotData[] plotData) { if (!_HoldOn) { ClearPlot(); } foreach (var t in plotData) { var points = t.Points; var title = t.Title; Labels.Add(title); DataSeriesCollection.Add(new DataPointCollection { DataPoints = points, Title = title, ColorTag = "ColorTag" }); PlotTitles.Add(Title); } UpdatePlotSeries(); }