答案 0 :(得分:1)
在这里,试试吧:
private void fillChart()
{
//AddXY value in chart1 in series named as Salary
chart1.Series["Salary"].Points.AddXY("Ajay", "10000");
chart1.Series["Salary"].Points.AddXY("Ramesh", "8000");
chart1.Series["Salary"].Points.AddXY("Ankit", "7000");
chart1.Series["Salary"].Points.AddXY("Gurmeet", "10000");
chart1.Series["Salary"].Points.AddXY("Suresh", "8500");
//chart title
chart1.Titles.Add("Salary Chart");
//These lines will show percentages.
chart1.ChartAreas[0].AxisY.LabelStyle.Format = "{#}%";
chart1.Series["Salary"].IsValueShownAsLabel = true;
chart1.Series["Salary"].LabelFormat = "{#}%";
}
答案 1 :(得分:0)
除了使用更强大的格式的Sak的答案之外,你可以通过Chart控件提供的Keywords得到一个简单的百分比:
yourSeries.Label = "#PERCENT";