Example #1
0
        public PlotModel CreatePlotModel()
        {
            var model = new PlotModel
            {
                Title                 = "Top 5 Neighborhood",
                LegendPlacement       = LegendPlacement.Outside,
                LegendPosition        = LegendPosition.BottomCenter,
                LegendOrientation     = LegendOrientation.Horizontal,
                LegendBorderThickness = 0
            };
            IFactory factory      = new ConcreteFactory();
            var      s1           = factory.CreateColumnSeriesBasic("Bike Storage Unit");
            var      categoryAxis = factory.CreateCategoryAxisBasic("Neighborhoods");
            var      valueAxis    = factory.CreateLinearAxisBasic("Total Amount");

            Dictionary <string, int> fs = preLoad.csvFT.getBarchart();

            foreach (KeyValuePair <string, int> item in fs)
            {
                s1.Items.Add(new ColumnItem {
                    Value = item.Value
                });
                categoryAxis.Labels.Add(item.Key);
            }

            model.Series.Add(s1);
            model.Axes.Add(categoryAxis);
            model.Axes.Add(valueAxis);

            return(model);
        }
Example #2
0
        public PlotModel CreatePlotModel()
        {
            var model = new PlotModel
            {
                Title                 = "Grouped chart of " + deelgem,
                LegendPlacement       = LegendPlacement.Outside,
                LegendPosition        = LegendPosition.BottomCenter,
                LegendOrientation     = LegendOrientation.Horizontal,
                LegendBorderThickness = 0
            };

            IFactory factory      = new ConcreteFactory();
            var      s1           = factory.CreateColumnSeriesBasic("Bike Thefts");
            var      s2           = factory.CreateColumnSeriesBasic("Bike Storage Units");
            var      categoryAxis = factory.CreateCategoryAxisMonths();
            var      valueAxis    = factory.CreateLinearAxisBasic("Total amount");

            Dictionary <int, int> fs = preLoad.csvFD.getBarchartGroupFD(buurt);

            foreach (KeyValuePair <int, int> item in fs)
            {
                s1.Items.Add(new ColumnItem {
                    Value = item.Value
                });
            }

            if (this.deelgem != null)
            {
                Dictionary <int, int> fs2 = preLoad.csvFT.getBarchartGroupFT(deelgem);
                foreach (KeyValuePair <int, int> item in fs2)
                {
                    s2.Items.Add(new ColumnItem {
                        Value = item.Value
                    });
                }
                model.Series.Add(s2);
            }


            model.Series.Add(s1);

            model.Axes.Add(categoryAxis);
            model.Axes.Add(valueAxis);

            return(model);
        }
Example #3
0
        public PlotModel CreatePlotModel()
        {
            var modelP1 = new PlotModel {
                Title = "Most stolen bike Color top 5", TitleColor = OxyColors.Black
            };
            IFactory factory  = new ConcreteFactory();
            var      seriesP1 = factory.CreatePieSeriesBasic();
            Dictionary <string, int> fdBrand = preLoad.csvFD.getPiechartColor();

            foreach (KeyValuePair <string, int> item in fdBrand)
            {
                seriesP1.Slices.Add(new PieSlice(item.Key, item.Value)
                {
                    IsExploded = true
                });
            }

            modelP1.Series.Add(seriesP1);

            return(modelP1);
        }
Example #4
0
        public PlotModel CreatePlotModel()
        {
            string title     = "Bike thefts a month";
            var    plotModel = new PlotModel
            {
                Title                 = title,
                TitleFontSize         = 24,
                LegendFontSize        = 24,
                LegendPlacement       = LegendPlacement.Inside,
                LegendPosition        = LegendPosition.RightTop,
                LegendOrientation     = LegendOrientation.Horizontal,
                LegendBorderThickness = 0
            };
            IFactory factory      = new ConcreteFactory();
            var      linearAxis   = factory.CreateLinearAxisBasic("Total amount");
            var      categoryAxis = factory.CreateCategoryAxisMonths();

            var series1 = new LineSeries
            {
                MarkerType   = MarkerType.Circle,
                MarkerSize   = 4,
                MarkerStroke = OxyColors.White,
                Title        = "total"
            };

            Dictionary <int, int> fd = preLoad.csvFD.getLinechart();

            foreach (KeyValuePair <int, int> item in fd)
            {
                series1.Points.Add(new DataPoint(item.Key - 1.5, item.Value));
            }

            plotModel.Series.Add(series1);
            plotModel.Axes.Add(categoryAxis);
            plotModel.Axes.Add(linearAxis);

            return(plotModel);
        }