フュージョン チャートで複数のシリーズを使用しようとしていますが、これまでのところ成功していません。使用したい新しいselectステートメントは次のとおりです。
string sqlStatement = "select Date, Category, COUNT(Status)TotalCount from MainTable group by Category";
ただし、Category と TotalCount の 2 つのフィールドしか使用していないため、以下のコードは正常に機能します。上記のように Date フィールドを追加したいと思います。ありがとう
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);
}