有没有办法使用融合图显示饼图的总和?我已经在 ASP 中创建了融合图表,我要做的就是显示饼图所有切片的总和值。例如,如果我的饼图上有 3 个切片:每个切片都有以下值:20、30、25;所以我想在子标题区域或图表顶部显示总共 75 个。有没有办法做到这一点?请帮忙。
public string CreateChart()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
string sqlStatement = "SELECT Category, AvgNumbers FROM MyTable";
SqlCommand cmd = new SqlCommand(sqlStatement, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
string strXML;
strXML = "<graph caption='Average Days To Close' subcaption='I want to show here the Total Sum' labelDisplay='auto' useEllipsesWhenOverflow='1' decimalPrecision='0' showValues='1' enablesmartlabels='0' showlabels='0' legendAllowDrag='1' numberSuffix=' Days' showLegend='1' pieSliceDepth='45' formatNumberScale='0'>";
while (reader.Read())
{
strXML += "<set name='" + reader["Category"].ToString() + "' value='" + reader["AvgNumbers"].ToString() + "' />";
}
strXML += "</graph>";
return FusionCharts.RenderChart("/FusionCharts/Pie3D.swf", "ChartID", strXML, "FactorySum", "450", "450", false, false);
}