public static AreaSeries CreateAreaSeries(DataSeriesViewModel dataSeries, Color color, bool firstSeries) { AreaSeries areaSeries = new AreaSeries(); SeriesLegendSettings legendSettings = new SeriesLegendSettings() { Title = dataSeries.Name }; areaSeries.LegendSettings = legendSettings; areaSeries.Fill = new SolidColorBrush(color); areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "XValue" }; areaSeries.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "YValue" }; areaSeries.ItemsSource = dataSeries.DataPoints; areaSeries.TrackBallInfoTemplate = CreateTooltipDataTemplate(dataSeries.Name, firstSeries); return(areaSeries); }
public static BarSeries CreateBarSeries(DataSeriesViewModel dataSeries, bool firstSeries) { BarSeries barSeries = new BarSeries(); SeriesLegendSettings legendSettings = new SeriesLegendSettings() { Title = dataSeries.Name }; barSeries.LegendSettings = legendSettings; barSeries.CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "XValue" }; barSeries.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "YValue" }; barSeries.ItemsSource = dataSeries.DataPoints; barSeries.TrackBallInfoTemplate = CreateTooltipDataTemplate(dataSeries.Name, firstSeries); barSeries.CombineMode = ChartSeriesCombineMode.Cluster; barSeries.PaletteMode = SeriesPaletteMode.Series; return(barSeries); }