Example #1
0
        private async Task GetAccountMetrics()
        {
            var result = await metricsManager.GetAccountEvolution(Account.Id);

            IncomeSeries.AddRange(result.IncomingSeries.TakeLast(5).Select(x => new SeriesValue
            {
                Value = x,
                Label = DateTime.Now.GetCurrentMonth(result.IncomingSeries.IndexOf(x) + 1)
            }));

            OutcomeSeries.AddRange(result.OutgoingSeries.TakeLast(5).Select(x => new SeriesValue
            {
                Value = x,
                Label = DateTime.Now.GetCurrentMonth(result.OutgoingSeries.IndexOf(x) + 1)
            }));

            OnPropertyChanged(nameof(IncomeSeries));
            OnPropertyChanged(nameof(OutcomeSeries));
            OnPropertyChanged(nameof(DisplaySeries));
        }