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:
精彩评论