我需要显示一个显示每月销售额的图表;我想将卷显示为一列,将销售显示为不同的列(每个月都有).然而,问题在于我每个月有多个销售价值,每个货币一个.我希望这是一个堆叠的列,显示不同的值一个在另一个上面.
我的问题是当我制作第二个系列堆叠列时,它将它堆叠在第一个值的顶部.我不希望这样.有人可以解释如何正确配置吗?
示例数据:
> 2011年1月:数量30,销售额:10美元,15英镑,0欧元
> 2011年2月:数量40,销售额:20美元,5英镑,5欧元
> 2011年3月:数量80,销售额:30美元,10英镑,10欧元
我在Visual Studio 2010中使用默认图表控件.这是一个WinForms应用程序,而不是Web.
解决方法
使用
StackedGroupName自定义属性.
To place multiple series in the same stacked group,assign the same
name to them.To show multiple stacks,assign different names to multiple series.
来自样本项目:
// Set the first two series to be grouped into Group1 chart1.Series["LightBlue"]["StackedGroupName"] = "Group1"; chart1.Series["Gold"]["StackedGroupName"] = "Group1"; // Set the last two series to be grouped into Group2 chart1.Series["Red"]["StackedGroupName"] = "Group2"; chart1.Series["DarkBlue"]["StackedGroupName"] = "Group2";