为什么下面的代码不能创建饼图?如何显示以百分比表示的值?
string[] seriesArray1 = new string[dataGridView1.Rows.Count];
double[] pointsArray1 = new double[dataGridView1.Rows.Count];
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
seriesArray1[i] = dataGridView1.Rows[i].Cells[0].Value.ToString();
pointsArray1[i] = Convert.ToDouble(dataGridView1.Rows[i].Cells[1].Value);
}
chart1.Titles.Add("Probability");
for (int i = 0; i < seriesArray1.Length; i++)
{
Series series = chart1.Series.Add(seriesArray1[i]);
series.ChartType = SeriesChartType.Pie;
series.IsValueShownAsLabel = true;
series.Points.Add(pointsArray1[i]);
}