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); }
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); }