[英]charting in c# using asp.net
我们可以设计一个点图,其中y轴的值表示xyz,abc等,而x轴的日期。 这意味着xyz可能在2012年11月28日,但是实际的x轴值将固定为一个月的间隔。
该点应映射在适当的位置。
如果可以设计,请告诉我。
对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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.