开发者

How can I bind an asp:chart (from microsoft) to a Dictionary<string,string>?

I'm using the MS chart controls for ASP.Net an开发者_开发知识库d I can't figure out binding. Does any one have information on how can I bind an asp:chart (from microsoft) to a dictionary?


var employees = new Dictionary<int, string>
{
    {10,"Employee 1"},{20,"Employee 2"},{30,"Employee 3"}
};

Chart1.Series[0].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Bar;

foreach (KeyValuePair<int, string> employee in employees)
    Chart1.Series[0].Points.AddXY(employee.Value, employee.Key);

Output:

How can I bind an asp:chart (from microsoft) to a Dictionary<string,string>?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜