0

xyz、abcなどのy軸値と日付付きのx軸を持つポイントチャートを設計できますか?これは、xyzが2012年11月28日になる可能性があることを意味しますが、実際のx軸の値はたとえば1か月間隔で固定されます。

ポイントは適切な場所にマッピングする必要があります。

これをデザインできたら、その方法を教えてください。

4

1 に答える 1

0

に標準値を使用しPoints、日付を次のように追加しますAxisLabel

public Series CreateSeries(Dictionary<DateTime, double> values)
{
    var series = new Series();

    //Our x Value   
    var x = 0;
    //Loop through our values-Collection ordered by the date
    foreach (var value in values.OrderBy(item => item.Key))
    {
        //Add a point using our dummy value
        series.Points.Add(
            new DataPoint(x, value.Value) 
            {
                //AxisLabel sets the X-Axis-Label - here: our datestring
                AxisLabel = item.Key.ToShortDateString() 
            });
        //increment our dummy
        x++;
    }

    return series;
}
于 2012-10-30T08:19:19.360 に答える