我正在尝试使用相对较新的Microsoft Chart Controls创建堆叠图表。我确信我遗漏了一些明显的东西,但一点帮助会有很长的路要走。下面的代码创建一个包含两列的图表。我希望柱子彼此堆叠。此外,我希望将两者的总数显示在图表上。任何帮助将非常感激。
Series activeSeries = new Series("Active");
activeSeries.ChartType = SeriesChartType.StackedColumn;
activeSeries.BorderWidth = 3;
activeSeries.ShadowOffset = 2;
activeSeries.Points.AddY(3000);
LaptopChart.Series.Add(activeSeries);
Series inactiveSeries = new Series("Inactive");
inactiveSeries.ChartType = SeriesChartType.StackedColumn;
inactiveSeries.BorderWidth = 3;
inactiveSeries.ShadowOffset = 2;
activeSeries.Points.AddY(987);
LaptopChart.Series.Add(inactiveSeries);