0

I want to graph some data with Date vs Value.
The problem is that I don't know how to make a PointPairList accept DateTime values and Double values.

4

2 に答える 2

2

ZedGraphには独自の日付形式があります。XDateDateTime
をXDateに簡単に変換できます。

詳細: http://zedgraph.org/wiki/index.php?title
= What_is_an_XDate_struct%3F
例:http://zedgraph.org/wiki/index.php?title = Tutorial:
Date_Axis_Chart_Demo

于 2010-07-26T20:12:51.570 に答える
1

What version of the framework are you using. If it's .NET 4 you can use a Tuple:

var dataPoints = new List<Tuple<DateTime, double>>();

If you are using an earlier framework version, you can instead create a simple class to hold the data points:

public class DataPoint
{
    public DateTime DateTime { get; set; }
    public double Value { get; set; }
}

...and use that instead:

var dataPoints = new List<DataPoint>();
于 2010-07-26T16:18:25.797 に答える