我正在尝试在 flowlayoutpanel 中添加图表作为控件,但是在执行所有图表后显示为空白如何解决这个问题?这是我的代码
flowLayoutPanel1.Controls.Clear();
System.Windows.Forms.DataVisualization.Charting.Series Series = new Series();
Chart[] chartMensal = new Chart[12];
for (int i = 1; i <= 12; i++)
{
string[] seriesArray = { "Total Contrato", "Total Vendas", "Total Despeses" };
Double[] pointsArray = { 1000, 1500, 500 };
chartMensal[i] = new Chart();
chartMensal[i].Width = this.Width - 100;
chartMensal[i].Height = 200;
chartMensal[i].Titles.Add(CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i).ToUpper());
chartMensal[i].Palette = ChartColorPalette.Fire;
chartMensal[i].Series.Clear();
Series.Points.Clear();
for (int t = 0; t < seriesArray.Length; t++)
{
Series.Points.Add(pointsArray[t]);
Series = chartMensal[i].Series.Add(seriesArray[t]);
}
chartMensal[i].Visible = true;
flowLayoutPanel1.Controls.Add(chartMensal[i]);
}