locked
FusionChartFree(FCF_Pie3D) in VS 2005 RRS feed

  • Question

  • User1192570106 posted

    Hi All,

    I want to add pie chart in my page...

    But chart is not showing....

    Here is my code:

      public string CreateTotalMarksChart()
        {
    
            //DbConn oRs;
            string strQuery;
    
            //strXML will be used to store the entire XML document generated
            string strXML;
    
            //Generate the graph element
            strXML = "<graph caption='Max Marks report' subCaption='By Marks' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>";
    
            //SQL Query
            strQuery = "select " +
                        "Subject,MaxMarks from " +
                        "(select PhyMaxMarks AS Physics, CheMaxMarks AS Chemistry, MathMaxMarks AS Math from dbo.tbl_test_info WHERE [TestInfoId]  = 1)u " +
                        "unpivot " +
                        "(MaxMarks for Subject in (Physics,Chemistry,Math))v";
            // Open Data Reader
            _sdrGetData = _clsDB.GetDataReader(strQuery);
            //oRs = new DbConn(strQuery);
    
            //Iterate through each factory
            while (_sdrGetData.Read())
            {
    
                //Generate <set name='..' value='..' /> 
                strXML += "<set name='" + _sdrGetData[0].ToString() + "' value='" + _sdrGetData[1].ToString() + "' />";
    
            }
            // Close Data Reader
            _sdrGetData.Close();
            //Finally, close <graph> element
            strXML += "</graph>";
    
            //Create the chart - Pie 3D Chart with data from strXML
            return FusionCharts.RenderChart("../Charts/FCF_Pie3D.swf", "", strXML, "MaxMarks", "650", "450",false, false);
    
        }


    litMaxMarks.Text = chart.CreateCombinationChart();


    It's showing only a string "Chart"..

    Please help!!!!!

    Tuesday, June 22, 2010 9:54 AM

All replies

  • User1192570106 posted

    Hi,

    My generated strXML string is here...

    <!-- START Script Block for Chart MaxMarks -->
    <div id='MaxMarksDiv' align='center'>
    Chart.
    </div>
    <script type="text/javascript">
    var chart_MaxMarks = new FusionCharts("../Charts/FCF_Pie3D.swf", "MaxMarks", "650", "450", "0", "0");
    chart_MaxMarks.setDataXML("<graph caption='Max Marks report' subCaption='By Marks' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'><set name='Physics' value='100' /><set name='Chemistry' value='150' /><set name='Math' value='200' /></categories></dataset></dataset></graph>");
    chart_MaxMarks.render("MaxMarksDiv");
    </script>
    <!-- END Script Block for Chart MaxMarks -->


    <!-- START Script Block for Chart Max Marks -->

    <div id='MaxMarksDiv' align='center'>

    Chart.

    </div>

    <script type="text/javascript">

    var chart_Max Marks = new FusionCharts("../Charts/FCF_Pie3D.swf", "Max Marks", "650", "450", "0", "0");

    chart_Max Marks.setDataXML("<graph caption='Max Marks report' subCaption='By Marks' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'><set name='Physics' value='100' /><set name='Chemistry' value='150' /><set name='Math' value='200' /></graph>");

    chart_Max Marks.render("MaxMarksDiv");

    </script>

    <!-- END Script Block for Chart Max Marks -->

    Anyone have any idea what's the problem???


    Wednesday, June 23, 2010 12:43 AM