在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
private void btn_Click(object sender, EventArgs e) { DBHelper db = new DBHelper(); DataSet ds = db.GetDataList(); this.dataGridView1.DataSource = ds.Tables[0]; DataSet ds1 = db.GetResportLine(); DataSet ds2 = db.GetResportLine2(); DataSet ds3 = db.GetResportLine3(); DataTable dt1 = ds1.Tables[0]; DataTable dt2 = ds2.Tables[0]; DataTable dt3 = ds3.Tables[0]; //chart1.ChartAreas[0].AxisX.Maximum = 1000;//设定x轴的最大值 //chart1.ChartAreas[0].AxisY.Maximum = 100;//设定y轴的最大值 //chart1.ChartAreas[0].AxisX.Minimum = 1;//设定x轴的最小值 //chart1.ChartAreas[0].AxisY.Minimum = 0;//设定y轴的最小值 //第一条数据 Series ss = new Series("dt1"); //这里 dt1 ,dt2 任意取名称,但要唯一 ss.Points.DataBind(dt1.AsEnumerable(), "xzhou", "yzhou", ""); ss.XValueType = ChartValueType.DateTime; //设置X轴 ss.ChartType = SeriesChartType.Spline; //设置Y轴为折线 chart1.Series.Add(ss); //第二条数据 Series ss2 = new Series("dt2"); ss2.Points.DataBind(dt2.AsEnumerable(), "xzhou2", "yzhou2", ""); ss2.XValueType = ChartValueType.DateTime; //设置X轴 ss2.ChartType = SeriesChartType.Spline; //设置Y轴为折线 chart1.Series.Add(ss2); //第三条数据 Series ss3 = new Series("dt3"); ss3.Points.DataBind(dt3.AsEnumerable(), "xzhou2", "yzhou2", ""); ss3.XValueType = ChartValueType.DateTime; //设置X轴 ss3.ChartType = SeriesChartType.Spline; //设置Y轴为折线 chart1.Series.Add(ss3); }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论