-1
如何在設計時更改這些藍色?我之前發現了一種方法,但它只改變了條上的顏色而不是傳說中的顏色。
該圖表可以顯示許多數據,這取決於用戶,所以我需要它來更改所有數據的顏色。謝謝
代碼:
private void loadchartFast()
{
chart1.Series[0].Points.Clear();
chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;
using (SqlConnection connection = new SqlConnection("Data Source=BENJOPC\\SQLEXPRESS;Initial Catalog=MARISCHELLdatabase;Integrated Security=True"))
{
SqlCommand command = new SqlCommand("SELECT TOP 5 ProductName, Sum(QtySold) as QtySold FROM Sales_productholder group by ProductName order by SUM(QtySold) desc", connection); //top selling with desc
connection.Open();
SqlDataReader read = command.ExecuteReader();
while (read.Read())
{
this.chart1.Series["Pieces Sold"].Points.AddXY(read["ProductName"], read["QtySold"]);
}
read.Close();
// chart3.Series["Pieces Sold"].Points[0].Color = Color.LightSeaGreen; ;
}
}
謝謝先生。我在自定義調色板中添加了一種顏色。我如何在自定義調色板中使用該顏色? – FutureDev
我明白了,我將調色板設置爲無。謝謝先生 – FutureDev
好消息。很高興它的作品。 –