0
我想顯示定製餅圖,這使得用戶選擇選項,並根據我的情況下,圖上 這是我的數據如何自定義使用SQL和C#
顯示設置餅圖顏色我想x軸totalacheivment,y是UCP,ibnsiena,海外
SqlCommand cmd1 = new SqlCommand("select Terriotry,UCPVol,IBNSINAVol,OVERSEASVol,TotalAcheivmentVol from ForecastTotal where Terriotry = '" + territory+"' and month ='"+Month+"' and year = '"+year+"'", conn);
try
{
conn.Open();
mydatareader = cmd1.ExecuteReader();
while (mydatareader.Read())
{
chart1.Series["UCP"].Points.AddXY(mydatareader.GetString(4), mydatareader.GetInt32(1));
chart1.Series["Ibnsiena"].Points.AddY(mydatareader.GetInt32(2));
chart1.Series["Overseas"].Points.AddY(mydatareader.GetInt32(3));
chart1.Series["UCP"]["PieLabelStyle"] = "Outside";
chart1.Series["UCP"]["PieLineColor"] = "Black";
chart1.DataBind();
chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;
chart1.ChartAreas[0].AxisX.Interval = 1;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
conn.Close();
我想用不同顏色顯示每個數字,以知道哪個數字與哪個列相關
對於餅圖只使用__one__系列!另外:你似乎在混合數據綁定圖表(更好地綁定一個系列的點!!)並添加點。請決定你想要做什麼! – TaW
可以清除PLZ嗎?我不知道哪個是最好的方式可以發佈代碼? –
在我的情況下,我想比較3個值之間如何在一個系列中做到這一點? –