示例#1
0
        private void CreateChart()
        {
            var          TotalActive  = SelectedCountry.TotalConfirmed - (SelectedCountry.TotalDeaths + SelectedCountry.TotalRecovered);
            List <Entry> ChartEntries = new List <Entry>();

            ChartEntries.Add(new Entry(TotalActive)
            {
                Label      = "Active",
                ValueLabel = NumberFormatter.ConvertToReadableformat(TotalActive),
                Color      = SKColor.Parse("#ff4a3d")
            });
            ChartEntries.Add(new Entry(SelectedCountry.TotalRecovered)
            {
                Label      = "Recovered",
                ValueLabel = TotalRecovered,
                Color      = SKColor.Parse("#77d065")
            });
            ChartEntries.Add(new Entry(SelectedCountry.TotalDeaths)
            {
                Label      = "Deceased",
                ValueLabel = TotalDeceased,
                Color      = SKColor.Parse("#82807a")
            });


            ConfirmedCasesChart = new BarChart()
            {
                Entries         = ChartEntries,
                BackgroundColor = SKColors.Transparent,
                PointMode       = PointMode.None,
                LabelTextSize   = 24,
            };
        }
示例#2
0
 private void SetValues(Country selectedCountry)
 {
     SelectedCountry = selectedCountry;
     TotalConfirmed  = NumberFormatter.ConvertToReadableformat(SelectedCountry.TotalConfirmed);
     TotalRecovered  = NumberFormatter.ConvertToReadableformat(SelectedCountry.TotalRecovered);
     TotalDeceased   = NumberFormatter.ConvertToReadableformat(SelectedCountry.TotalDeaths);
     NewConfirmed    = $"[+{NumberFormatter.ConvertToReadableformat(SelectedCountry.NewConfirmed)}]";
     NewRecovered    = $"[+{NumberFormatter.ConvertToReadableformat(SelectedCountry.NewDeaths)}]";
     NewDeceased     = $"[+{NumberFormatter.ConvertToReadableformat(SelectedCountry.NewRecovered)}]";
     UpdatedAt       = SelectedCountry.UpdatedDate.ToString("MM/dd/yy HH:mm");
 }
 private void SetStatValues(CoronaStats coronaStats)
 {
     TotalConfirmed = NumberFormatter.ConvertToReadableformat(coronaStats.Global.TotalConfirmed);
     TotalRecovered = NumberFormatter.ConvertToReadableformat(coronaStats.Global.TotalRecovered);
     TotalDeceased  = NumberFormatter.ConvertToReadableformat(coronaStats.Global.TotalDeaths);
     NewConfirmed   = $"[+{NumberFormatter.ConvertToReadableformat(coronaStats.Global.NewConfirmed)}]";
     NewRecovered   = $"[+{NumberFormatter.ConvertToReadableformat(coronaStats.Global.NewDeaths)}]";
     NewDeceased    = $"[+{NumberFormatter.ConvertToReadableformat(coronaStats.Global.NewRecovered)}]";
     UpdatedAt      = coronaStats.UpdatedDate.ToString("MM/dd/yy HH:mm");
     AddCountries(coronaStats);
 }