private static void CopyPointsFromTrendToSeries(ITrendViewModel trendViewModel, XyDataSeries <DateTime, double> dataSeries) { foreach (var dataPoint in trendViewModel.TrendData.Trend) { dataSeries.Append(dataPoint.Time, dataPoint.Value); } }
private IChartSeriesViewModel CreateChartSeriesViewModel(ITrendViewModel trendViewModel, bool discrete) { var dataSeries = new XyDataSeries <DateTime, double> { SeriesName = trendViewModel.Title }; CopyPointsFromTrendToSeries(trendViewModel, dataSeries); IRenderableSeries series = null; if (discrete) { series = new FastMountainRenderableSeries { DataSeries = dataSeries, Tag = trendViewModel, AntiAliasing = false, IsDigitalLine = true, ResamplingMode = ResamplingMode.None }; } else { series = new FastLineRenderableSeries { DataSeries = dataSeries, Tag = trendViewModel, }; } ChooseSeriesColor(trendViewModel, series); return(new ChartSeriesViewModel(dataSeries, series)); }
private void CheckIfColorChanged(ITrendViewModel trend, IChartSeriesViewModel seriesViewModel) { var color = _colorsStorage.GetColor(trend.ConfigGuid); if (seriesViewModel.RenderSeries.SeriesColor != color) { _colorsStorage.SetColor(trend.ConfigGuid, seriesViewModel.RenderSeries.SeriesColor); _colorsStorage.Save(); } }
private void ChooseSeriesColor(ITrendViewModel trendViewModel, IRenderableSeries lineSeries) { var color = _colorsStorage.GetColor(trendViewModel.ConfigGuid); if (color.HasValue) { lineSeries.SeriesColor = color.Value; } else { lineSeries.SeriesColor = GetColorForNewLine(); _colorsStorage.SetColor(trendViewModel.ConfigGuid, lineSeries.SeriesColor); _colorsStorage.Save(); } }
private void AddTrendToPlot(ISciChartViewModel sciChartViewModel, ITrendViewModel trend) { if (trend.IsOnPlot) { IsTrendLoading = true; trend.IsTrendLoading = true; sciChartViewModel.AddTrend(trend, result => { IsTrendLoading = false; trend.IsTrendLoading = false; }); } else { sciChartViewModel.RemoveTrend(trend); } }
public SeriesAdditionalData(IChartSeriesViewModel chartSeriesViewModel, ITrendViewModel trendViewModel) { TrendViewModel = trendViewModel; ChartSeries = chartSeriesViewModel; }
public IsTrendOnPlotChangedMessage(ITrendViewModel trend) { Trend = trend; }