【发布时间】:2013-01-06 12:05:45
【问题描述】:
当我在没有放置图表类型的情况下执行此操作时工作正常,但当我将其设置为饼图时,它无法正常工作。它将所有系列名称作为点 1,馅饼只有 1 个蓝色块(一个圆圈),它只显示第一个点(值)。
foreach (var tag in tags)
{
HtmlNode tagname = tag.SelectSingleNode("a");
HtmlNode tagcount = tag.SelectSingleNode("span/span");
chart1.Series.Add(tagname.InnerText);
chart1.Series[x].Points.AddY(int.Parse(tagcount.InnerText));
chart1.Series[x].IsValueShownAsLabel = true;
chart1.Series[x].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
x++;
}
【问题讨论】: