我有一个系列,其中用数据库中的记录填充图表。显示了七个记录,但颜色鲜亮。
我正在尝试更改每个条形颜色而没有成功

以下是我尝试过的行,但我给了我一个大的绿色条(:
private void button1_Click(object sender, EventArgs e)
{
/*First empty the chart2 to fire the current data*/
if (cbChart.SelectedItem == null)
{
chart.Visible = false;
chart.Controls.Clear();
}
else
//pnchart.Controls.Clear();
chart.Visible = true;
chart.Titles.Clear();
/*Add a new title*/
Title bezeichung = new Title("Finance" + Environment.NewLine + "(GWU)", Docking.Top, new Font("Yu Gothic", 8, FontStyle.Bold), Color.Black);
chart.Titles.Add(bezeichung);
chart.Titles.Add(bezeichung2);
if (cbChart.SelectedItem != null)
{
string S = ConfigurationManager.ConnectionStrings[""].ConnectionString;
SqlConnection con = new SqlConnection(S);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType …Run Code Online (Sandbox Code Playgroud)