Exemple #1
0
 private static void CopyPointsFromTrendToSeries(ITrendViewModel trendViewModel, XyDataSeries <DateTime, double> dataSeries)
 {
     foreach (var dataPoint in trendViewModel.TrendData.Trend)
     {
         dataSeries.Append(dataPoint.Time, dataPoint.Value);
     }
 }
Exemple #2
0
        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));
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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();
            }
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
 public SeriesAdditionalData(IChartSeriesViewModel chartSeriesViewModel, ITrendViewModel trendViewModel)
 {
     TrendViewModel = trendViewModel;
     ChartSeries    = chartSeriesViewModel;
 }
Exemple #7
0
 public IsTrendOnPlotChangedMessage(ITrendViewModel trend)
 {
     Trend = trend;
 }