4,817
社区成员
发帖
与我相关
我的任务
分享
string[] xval = { "Peter", "Andrew", "Julie", "Mary", "Dave" };
double[] yval1 = { 2,5,6,4,3 };
double[] yval2 = { 8,6,2,3,4 };
Chart1.Series["Series1"].Points.DataBindXY(xval, yval1,yval2);
Chart1.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.RangeColumn;
//连接数据库.....
da.Fill(ds);填充DataSet
DataView myView = new DataView(ds.Tables[0]);
Chart1.Series["Series1"].Points.DataBindXY(myView, "x轴字段", myView, "y轴字段1,y轴字段2");//数据邦定
Chart1.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.RangeColumn;//设置图形