使用Silverlight Toolkit绘制图表(上)--柱状图
2009-02-10 11:57:18 来源:WEB开发网而数据源是在程序中直接写死的,如下:
/**//// <summary>
/// City business object used for charting samples.
/// </summary>
public class City
{
/**//// <summary>
/// Gets or sets the name of the city.
/// </summary>
public int ID { get; set; }
/**//// <summary>
/// Gets or sets the name of the city.
/// </summary>
public string Name { get; set; }
/**//// <summary>
/// Gets or sets the population of the city.
/// </summary>
public int Population { get; set; }
/**//// <summary>
/// Initializes a new instance of the City class.
/// </summary>
public City()
{
}
/**//// <summary>
/// Returns a string that represents the current object.
/// </summary>
/// <returns>A string that represents the current object.</returns>
public override string ToString()
{
return Name;
}
/**//// <summary>
/// Gets a collection of cities in the Puget Sound area.
/// </summary>
public static ObjectCollection PugetSound
{
get
{
ObjectCollection pugetSound = new ObjectCollection();
pugetSound.Add(new City { Name = "张庄", Population = 312344, ID = 1 });
pugetSound.Add(new City { Name = "李庄", Population = 411212, ID = 2 });
pugetSound.Add(new City { Name = "赵庄", Population = 261391, ID = 3 });
pugetSound.Add(new City { Name = "马家河子", Population = 530022, ID = 4 });
return pugetSound;
}
}
}
Tags:使用 Silverlight Toolkit
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接