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);
}
Participant
1317 Points
426 Posts
FusionChartFree(FCF_Pie3D) in VS 2005
Jun 22, 2010 09:54 AM|Pratap09|LINK
Hi All,
I want to add pie chart in my page...
But chart is not showing....
Here is my code:
It's showing only a string "Chart"..
Please help!!!!!
Participant
1317 Points
426 Posts
Re: FusionChartFree(FCF_Pie3D) in VS 2005
Jun 23, 2010 12:43 AM|Pratap09|LINK
Hi,
My generated strXML string is here...
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"><!-- START Script Block for Chart MaxMarks --></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"><div id='MaxMarksDiv' align='center'></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">Chart.</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"></div></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"><script type="text/javascript"></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">var chart_MaxMarks = new FusionCharts("../Charts/FCF_Pie3D.swf", "MaxMarks", "650", "450", "0", "0");</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">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>");</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">chart_MaxMarks.render("MaxMarksDiv");</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"></script></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"><!-- END Script Block for Chart MaxMarks --></div><!-- 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???