我们可以设计一个点图表与y轴值,如xyz,abc等和x轴与日期。这意味着xyz可能在28/11/2012,但实际的x轴值将以例如一个月的间隔固定。
应将该点绘制在适当的点上。
如果我们可以设计这个,那么请让我知道如何。
发布于 2012-10-30 16:19:19
对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;
}https://stackoverflow.com/questions/13134809
复制相似问题