获得现有曲线中的所有点?

时间:2010-07-28 17:59:21

标签: c# zedgraph

我正在使用ZedGraph并想知道如何找到构成整个曲线的点。

foreach(var Curve in GraphPane.CurveList)
{
    foreach(var Point in Curve.???)
    {
        Console.WriteLine(Point.X+" "+Point.Y); // <- I'm not sure if this is correct, but this is what I want
    }
}

我该如何做到这一点?

1 个答案:

答案 0 :(得分:1)

基于文档(http://zedgraph.sourceforge.net/documentation/html/T_ZedGraph_CurveList.htm),也许可以尝试这样的事情:

foreach( var Curve in GraphPane.CurveList )
{
    for ( int i = 0; i < Curve.Points.Count; i++ )
    {        
        var Pt = Curve.Points[i];
        Console.WriteLine(Pt.X+" "+Pt.Y);
    }
}