List<ChouShuiDanKongShuJu> JianYanShuJu1 = IDBContext.QueryDB().Sql(@"select * from T_ChouShuiDanKongShuJu where StrID='" + strShiYanID + "'and C_ChouShuiLeiXing='稳定流抽水试验' order by C_ChouShuiYanXuShiJianMin")
.QueryMany<ChouShuiDanKongShuJu>();
if (JianYanShuJu1.Count == 0)
{
MessageBox.Show("请确定已输入试验观测数据!");
return;
}
PointPairList listD = new PointPairList();
PointPairList listDG = new PointPairList();
ZedGraph.LineItem[] line=new LineItem[2];
List<ChouShuiDanKongShuJu> DanKongShu = new List<ChouShuiDanKongShuJu>();
GetChouShuiShiYanShuJu.GetDanKongShuJu(strShiYanID, "停泵前' OR C_ChouShuiDuan = '停泵后", out DanKongShu);
foreach (var item in DanKongShu)
{
double z = item.C_GuanCeKongJiangShen;
double x = item.C_ChouShuiYanXuShiJianMin;
double y = item.C_ZhuKongJiangShen;
listD.Add(x, -y);
listDG.Add(x,-z);
}
zedChouShuiShiYanFir.GraphPane.CurveList.Clear();
line [0]= zedChouShuiShiYanFir.GraphPane.AddCurve("主孔降深", listD, Color.Red);
line [1]= zedChouShuiShiYanFir.GraphPane.AddCurve("观测孔降深", listDG, Color.Green);
zedChouShuiShiYanFir.AxisChange();
zedChouShuiShiYanFir.Refresh();
//怎么显示两条曲线在一个GraphPane上
在添加曲线前应先声明一个‘画布’ GraghPane gp=zedChouShuiShiYanFir.GraghPane;
在此画布上添加多条曲线就可以了