Exemplo n.º 1
0
        public async void GenerateGraph()
        {
            BrandColorGenerator generator = new BrandColorGenerator();

            BikeColorsGraphModel bg = await generator.GenerateColors();

            colorChart.Legend            = new ChartLegend();
            colorChart.Legend.Title.Text = "Most stolen colours (Swipe left-to-right for brands)";


            colorChart.Series.Add(new PieSeries()
            {
                ItemsSource       = bg.model,
                XBindingPath      = "Name",
                YBindingPath      = "Count",
                EnableTooltip     = true,
                EnableAnimation   = true,
                AnimationDuration = 3,
                EnableSmartLabels = true
            });
        }
Exemplo n.º 2
0
        public async void GenerateGraph()
        {
            Project4Bicycle.BrandColorGenerator generator = new Project4Bicycle.BrandColorGenerator();

            Project4Bicycle.Models.BikeBrandsGraphModel bg = await generator.GenerateBrands();

            BrandColorGenerator generator2 = new BrandColorGenerator();

            Project4Bicycle.Models.BikeColorsGraphModel bg2 = await generator.GenerateColors();

            List <string> brand = new List <string>();

            List <int> amount = new List <int>();

            for (var i = 0; i < bg.model.Count; i++)
            {
                Brand tt = bg.model[i];
                brand.Add(tt.Name);
                amount.Add(tt.Count);
            }

            List <string> color = new List <string>();

            List <int> amount2 = new List <int>();

            for (var j = 0; j < bg2.model.Count; j++)
            {
                dynamic tt = bg2.model[j];
                color.Add(tt.Name);
                amount2.Add(tt.Count);
            }

            chart5.Series[0].Points.DataBindXY(brand, amount);
            chart5.Series[0].Name = "Thefts";

            chart4.Series[0].Points.DataBindXY(color, amount2);
            chart4.Series[0].Name = "Thefts";
        }