gpt4 book ai didi

c# - 如何绑定(bind) asp :chart (from microsoft) to a Dictionary

转载 作者:太空宇宙 更新时间:2023-11-03 11:46:11 25 4
gpt4 key购买 nike

我正在使用 ASP.Net 的 MS 图表控件,但我无法弄清楚绑定(bind)。有没有人知道如何将 asp:chart(来自 Microsoft)绑定(bind)到字典?

最佳答案

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);

输出:

Chart

关于c# - 如何绑定(bind) asp :chart (from microsoft) to a Dictionary<string, string>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3392268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com