使用devexpress控件,如何让chartcontrol显示多条曲线?
展开全部
this.chartControl1.Series.Clear();
Series cl = new Series("均线", ViewType.Spline);
Series item_value = new Series("样本值", ViewType.Spline);
Series ucl = new Series("控制上限", ViewType.Spline);
Series lcl = new Series("控制下限", ViewType.Spline);
decimal stdev = Stdev(dt_k); //标准偏差
decimal ucl_value = UCL(dt_k); // 控制上限(UCL)
decimal lcl_value = LCL(dt_k); //控制下限(LCL)
decimal cl_vaule = Avg_Item_x(dt_k);
for(int i = 0;i<dt_k.Rows.Count;i++)
{
cl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(),new double[]{Convert.ToDouble(cl_vaule)}));
item_value.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(),
new double[] { Convert.ToDouble(dt_k.Rows[i]["C_ITEMVALUE"].ToString()) }));
ucl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(), new double[] { Convert.ToDouble(ucl_value) }));
lcl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(), new double[] { Convert.ToDouble(lcl_value) }));
}
this.chartControl1.Series.Add(cl);
this.chartControl1.Series.Add(item_value);
this.chartControl1.Series.Add(ucl);
this.chartControl1.Series.Add(lcl);
Series cl = new Series("均线", ViewType.Spline);
Series item_value = new Series("样本值", ViewType.Spline);
Series ucl = new Series("控制上限", ViewType.Spline);
Series lcl = new Series("控制下限", ViewType.Spline);
decimal stdev = Stdev(dt_k); //标准偏差
decimal ucl_value = UCL(dt_k); // 控制上限(UCL)
decimal lcl_value = LCL(dt_k); //控制下限(LCL)
decimal cl_vaule = Avg_Item_x(dt_k);
for(int i = 0;i<dt_k.Rows.Count;i++)
{
cl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(),new double[]{Convert.ToDouble(cl_vaule)}));
item_value.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(),
new double[] { Convert.ToDouble(dt_k.Rows[i]["C_ITEMVALUE"].ToString()) }));
ucl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(), new double[] { Convert.ToDouble(ucl_value) }));
lcl.Points.Add(new SeriesPoint(dt_k.Rows[i]["c_sampleid"].ToString(), new double[] { Convert.ToDouble(lcl_value) }));
}
this.chartControl1.Series.Add(cl);
this.chartControl1.Series.Add(item_value);
this.chartControl1.Series.Add(ucl);
this.chartControl1.Series.Add(lcl);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询