求助!chartControl1.SeriesTemplate.ValueDataMembers.AddRange出错
本帖最后由 cutesun 于 2015-9-8 16:55 编辑数据表如下:
日期作物发育期年份
2015/9/3水稻成熟1991
2015/9/5水稻成熟1990
2015/9/2水稻成熟1989
2015/9/4水稻成熟1988
2015/9/1水稻成熟1987
2015/9/9水稻成熟1985
2015/8/1玉米成熟1984
2015/9/7水稻成熟1983
2015/7/31玉米成熟1982
2015/8/31水稻成熟1981
2015/9/7水稻成熟1980
代码如下:
chartControl1.DataSource = fyq;
chartControl1.SeriesDataMember = "作物发育期";
chartControl1.SeriesTemplate.ArgumentDataMember = "日期";
chartControl1.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "年份" });
chartControl1.SeriesTemplate.View = new StackedBarSeriesView();
标注那行错误提示:An unhandled exception of type 'System.ArgumentException' occurred in DevExpress.XtraCharts.v15.1.dll
Additional information: It's necessary to specify 2 value data members for the current series view.
求高人指点!!
终于改好了,原来chartControl1.SeriesTemplate.ValueDataMembers.AddRange一行应该写成
chartControl1.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "年份","年份" });
好扯……
页:
[1]