我的数据
代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | chartControl1.Series.Clear(); // 柱状图里的第一个柱 Series Series1 = new Series( "当年数据" , ViewType.Bar); Series1.DataSource = data; Series1.ArgumentScaleType = ScaleType.Qualitative; // 以哪个字段进行显示 Series1.ArgumentDataMember = "GROUPCOLUMNNAME" ; Series1.ValueScaleType = ScaleType.Numerical; // 柱状图里的柱的取值字段 Series1.ValueDataMembers.AddRange( new string [] { "CURRENTQUANTITY" }); // 柱状图里的第二柱 Series Series2 = new Series( "累计数据" , ViewType.Bar); Series2.DataSource = data; Series2.ArgumentScaleType = ScaleType.Qualitative; Series2.ArgumentDataMember = "GROUPCOLUMNNAME" ; Series2.ValueScaleType = ScaleType.Numerical; Series2.ValueDataMembers.AddRange( new string [] { "TOTALQUANTITY" }); chartControl1.Series.Add(Series1); chartControl1.Series.Add(Series2); |