protected override void LoadDataPoints()
        {
            Application.Current.Dispatcher.Invoke(() =>
            {
                DataFilter filter = GetFilter(ReportType);
                DataPoints.Clear();
                var dataPoints = filter.Filter <PieChartDataPoint>(_dataModel.Transactions, StartDate, EndDate);

                foreach (var dataPoint in dataPoints)
                {
                    DataPoint existingDataPoint = GetDataPoint(dataPoint.Name);

                    if (existingDataPoint != null)
                    {
                        PieChartDataPoint newDataPoint = new PieChartDataPoint
                        {
                            Name  = dataPoint.Name,
                            Value = ((PieChartDataPoint)existingDataPoint).Value += dataPoint.Value,
                        };

                        DataPoints.Remove(existingDataPoint);
                        DataPoints.Add(newDataPoint);
                    }
                    else
                    {
                        DataPoints.Add(dataPoint);
                    }
                }
            });
        }
Esempio n. 2
0
        public void Clear()
        {
            DataPoints.Clear();
            LowActivityDataPoints.Clear();
            HighActivityDataPoints.Clear();
            Categories.Clear();

            WatchDataNotYetLoaded = SetDataNotYetLoaded = true;
        }
Esempio n. 3
0
        protected override void LoadDataPoints()
        {
            Application.Current.Dispatcher.Invoke(() =>
            {
                DataFilter filter = GetFilter(ReportType);
                DataPoints.Clear();

                var dataPoints = new List <LineChartDataPoint>();

                //Add an empty data point to start at the origin.
                dataPoints.Add(new LineChartDataPoint {
                    X = StartDate, Y = 0,
                });

                dataPoints.AddRange(filter.Filter <LineChartDataPoint>(_dataModel.Transactions, StartDate, EndDate));
                foreach (var dataPoint in dataPoints)
                {
                    DataPoints.Add(dataPoint);
                }
            });
        }