zedgraph多条曲线问题
从文本中读取数据 用zedgraph来绘线
文本格式如下(按行显示)其中以2开头的行为标记,代表一条曲线,以1开头的行为坐标数据。每条曲线点个数不一样。
2 x y //======随后的是曲线的坐标数据(曲线1)
1 1 2
1 2 3
1 3 6
2 x y //======随后的是曲线坐标数据(曲线2)
1 3 5
1 6 7
....
我是如下读数绘图 但是只画出一条曲线
string str; int k =0; ZedGraph::PointPairList listh=gcnew ZedGraph::PointPairList();
while(string str= Readline()) //按行读取
{
if(str[0]=='2')
{
if(k>0)
{ghrace->GraphPane->AddCurve("",listh,System::Drawing::Color::Red,ZedGraph::SymbolType::None);} listh->clear(); 这里清空为下一条曲线添入坐标数据
}
if(str[0]=='1')
{listh->add(x,y) .......................这里添加下一条曲线数据
}
}