async Task GetReportAsync(string dateFrom, string dateTo) { IsLoading = true; var responce = await ReportModel.FetchReport(dateFrom, dateTo); var success = responce.Status == true; if (success) { Report = responce; } else { await App.Current.MainPage.DisplayAlert("Error", responce.GetMessage(), "Ok"); } IsLoading = false; }
async Task GetReportAsync(string dateFrom, string dateTo) { IsLoading = true; var responce = await ReportModel.FetchReport(dateFrom, dateTo); var success = responce.Status == true; if (success) { Report = responce; //Creating PieChart var entries = new[] { new Entry(TotalBilledSecondsLong) { Color = SkiaSharp.SKColor.Parse("#f37a3f"), //Label = "Billed Seconds", //ValueLabel = TotalBilledSecondsLong.ToString() }, new Entry(Report.Report.ReportInfo.TotalPauseAmountSeconds) { Color = SkiaSharp.SKColor.Parse("#2e86c1"), //Label = "Paused Seconds", //ValueLabel = Report.Report.ReportInfo.TotalPauseAmountSeconds.ToString() } }; ReportChart = new PieChart() { Entries = entries, BackgroundColor = SkiaSharp.SKColor.Parse("#eeeeee") }; //PieChart Creation Completed } else { await App.Current.MainPage.DisplayAlert("Error", responce.GetMessage(), "Ok"); } IsLoading = false; }