title: stacked column chart fusion charts using sql server database
body: <p>I have a requirement to develop <strong>stacked column</strong> charts using FusionCharts XT trial version. I could not find any examples using data source as database for <strong>stacked column</strong>. They have shown examples using XML/JSON. Please help me if you have experience in this area of using FusionCharts. Thanks in advance.</p>
  
  <p>Below is my current code.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data.SqlClient;
  using InfoSoftGlobal;
  namespace workflowmangement
  {
       public partial class chart1 : System.Web.UI.Page
       {
          string conString =            System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
          protected void Page_Load(object sender, EventArgs e)
          {
              siva.Text = CreateChart();
          }
       public string CreateChart()
  
            {
  
  
                  SqlConnection con = new SqlConnection(conString);
  
                  string sqlStatement = "SELECT Activity_Name,Activity_Id from Activity";
  
                  SqlCommand cmd = new SqlCommand(sqlStatement, con);
  
                  con.Open();
  
                  SqlDataReader reader = cmd.ExecuteReader();
  
                  string strXML;
  
                 strXML = "&lt;graph caption='Category Wise Quantity' subCaption='By Quantity'     decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30'     formatNumberScale='0'&gt;";
  
                 while (reader.Read())
  
                 {
  
                     strXML += "&lt;set name='" + reader["Activity_Name"].ToString() + "' value='" + reader["Activity_Id"].ToString() + "' /&gt;";
  
                 }
  
                 strXML += "&lt;/graph&gt;";
  
                 return FusionCharts.RenderChart("/FusionCharts/FCF_Pie3D.swf", "", strXML, "FactorySum", "650", "450", false, false);
  
            }
  
      }
  }
  </code></pre>