我试图在我的融合图中使用多个系列,但到目前为止我无法成功。这是我想在其中使用的新选择语句:
string sqlStatement = "select Date, Category, COUNT(Status)TotalCount from MainTable group by Category";
但是下面的代码可以正常工作,因为我只使用了 2 个字段:Category 和 TotalCount。我想添加如上所示的日期字段。谢谢
public string CreateHistoricalChart()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
string sqlStatement = "select Category, COUNT(Status)TotalCount from MainTable group by Category";
SqlCommand cmd = new SqlCommand(sqlStatement, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
string strXML;
strXML = "<graph decimalPrecision='0' name='MyXScaleAnim' type='ANIMATION' duration='1' start='0' param='_xscale' showNames='1' labelDisplay='Rotate' useEllipsesWhenOverflow='1' pieSliceDepth='30' formatNumberScale='0'>";
while (reader.Read())
{
strXML += "<set name='" + reader["Category"].ToString() + "' value='" + reader["TotalCount"].ToString() + "' />";
}
strXML += "</graph>";
return FusionCharts.RenderChart("../FusionCharts/Column3D.swf", "ChartID", strXML, "FactorySum6", "870", "350", false, true);
}