Exemplo n.º 1
0
 /// <summary>
 ///     Set a custom CashFlowModel with the set Start and Enddate
 /// </summary>
 private void LoadCashFlowData()
 {
     //TODO: Unit Test for order!
     //TODO: Unit Test for selection.
     StatisticItems.Clear();
     StatisticItems.AddRange(cashFlowDataProvider.GetCashFlow(StartDate, EndDate));
 }
        /// <summary>
        ///     Set a custom CashFlowModel with the set Start and Enddate
        /// </summary>
        private async Task LoadCashFlowData()
        {
            //TODO: Unit Test for order!
            //TODO: Unit Test for selection.
            StatisticItems.Clear();

            var statisticData = await cashFlowDataProvider.GetCashFlow(StartDate, EndDate);

            foreach (var statisticItem in statisticData)
            {
                StatisticItems.Add(statisticItem);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Set a custom CashFlowModel with the set Start and Enddate
        /// </summary>
        public PlotModel GetCashFlowModel()
        {
            var cashFlow = cashFlowDataProvider.GetCashFlow(StartDate, EndDate);

            var model = new PlotModel();

            var columnSeries = new ColumnSeries();
            var axe          = new CategoryAxis
            {
                IsPanEnabled  = false,
                IsZoomEnabled = false,
                Angle         = 45
            };

            if (settingsManager.IsDarkThemeSelected)
            {
                axe.AxislineColor = OxyColors.White;
                axe.TextColor     = OxyColors.White;

                model.Background = OxyColors.Black;
                model.TextColor  = OxyColors.White;
            }
            else
            {
                axe.AxislineColor = OxyColors.Black;
                axe.AxislineColor = OxyColors.Black;

                model.Background = OxyColors.White;
                model.TextColor  = OxyColors.Black;
            }

            columnSeries.Items.Add(new ColumnItem(cashFlow.Income.Value)
            {
                Color = OxyColors.LightGreen
            });
            axe.Labels.Add(cashFlow.Income.Label);
            columnSeries.Items.Add(new ColumnItem(cashFlow.Expense.Value)
            {
                Color = expenseRed
            });
            axe.Labels.Add(cashFlow.Expense.Label);
            columnSeries.Items.Add(new ColumnItem(cashFlow.Revenue.Value)
            {
                Color = OxyColors.Cyan
            });
            axe.Labels.Add(cashFlow.Revenue.Label);

            model.Axes.Add(axe);
            model.Series.Add(columnSeries);
            return(model);
        }