2014-01-22 54 views
1
chart.Series[0].Points.AddXY(dt1.Rows[i].ItemArray[0], dt1.Rows[i].ItemArray[3]); 
chart.ChartAreas[0].AxisY.LabelStyle.Format = "{#'%'}"; 
chart.Series[0].IsValueShownAsLabel = true; 
chart.Series[0].Label = "#VALY{P1}"; 
chart.Series[0].CustomProperties = "BarLabelStyle = Right"; 

其創建圖表的代碼,在那裏系列標籤我得到8000%,而不是80%,你能幫我解決。圖形系列標籤修改

+0

[1]:http://i.stack.imgur.com/ZCcS9.png是這張圖片。 – user3218871

+0

你用什麼控制圖表? –

+0

asp .net圖表控件。 – user3218871

回答

1

我不知道你要綁定到視圖的價值,但我會猜測其80,所以你需要改變這一點:

chart.ChartAreas[0].AxisY.LabelStyle.Format = "{#'%'}"; 

這個

chart.ChartAreas[0].AxisY.LabelStyle.Format = "{#}%"; 

的百分比格式會自動乘以100你的值這就是爲什麼你得到8000而不是80.

+0

chart.Series [0] .Label =「#VALY {P1}」;在這裏我需要改變這個值。那麼你能告訴我任何修改可以做到嗎? – user3218871