bigz Report post Posted October 16, 2011 Hi, I am using 3D pie chart with PHP and want to render it with flash by default.Few days ago, I upgraded fusion charts to the latest version which suppose to fully support javascript.However, since then I get in many cases the error: "No data to display" or blank page when page is loaded and only after refreshing or second call I will see the chart (in most cases). Please note that before the upgrade , I didn't have this issue. When I am forcing it to use javascript :FC_SetRenderer( "javascript" ); it works well.My code looks like that: FC_SetDataFormat("json"); echo renderChart("/pages/category/charts/FusionCharts/Pie3D.swf", $dataURL, "", "previewChart", "100%" , "100%", false, true); Debug info: Info: Chart loaded and initialized.Initial Width: 475Initial Height: 220Scale Mode: noScaleDebug Mode: YesApplication Message Language: ENVersion: 3.2.2(XT)Chart Type: 3D Pie ChartChart Objects: BACKGROUNDCANVASCAPTIONSUBCAPTIONDATALABELSDATAPLOTTOOLTIPLEGEND INFO: Chart registered with external script. DOM Id of chart is previewChartINFO: XML Data provided using dataXML method.XML Data: undefinedINFO: setDataXML method invoked from external script.INFO: XML Data provided using dataXML method.No Data to Display: No data was found in the XML data document provided. Possible cases can be: There isn't any data generated by your system. If your system generates data based on parameters passed to it using dataURL, please make sure dataURL is URL Encoded.You might be using a Single Series Chart .swf file instead of Multi-series .swf file and providing multi-series data or vice-versa. No Data to Display: No set node defined. Thanks in advance!! Share this post Link to post Share on other sites
Guest Angshu Report post Posted October 17, 2011 Hi, Welcome to FusionCharts Forum! If your chart shows a "No data to display" message, it could be the following scenarios: Your XML data doesn't contain any data that could be plotted by FusionCharts. In this case, your XML just contains the <chart> or <dataset> tags without any data between them. You might be using a single-series chart SWF and providing data in multi-series format or vice-versa. In this case too, you'll get a "No data to display" message. In case the problem persists, please send us the entire code to look into the issue and confirm the browser version you are using. Awaiting for your response. Share this post Link to post Share on other sites
bigz Report post Posted October 17, 2011 Hi, I am showing you snippets of the FusionChart code. This code worked fine before the upgrade, and when we change the engine to JS it works ok. The behavior is that when we open the site for the first time, the Pie chart shows "Not Data". If i refresh the page, it shows ok. The PHP code itself, looks like this: FC_SetDataFormat("json"); echo renderChart("pages/category/charts/FusionCharts/Pie3D.swf", "data/chart/preview/root$brands.json", "", "previewChart", 700, 400, false, true); The JS code reaching the client, looks like this: <!-- START Code Block for Chart previewChart --><div id="previewChartDiv">Chart</div><script type="text/javascript" ><!-- // Instantiate the Chart if ( FusionCharts("previewChart") && FusionCharts("previewChart").dispose ) FusionCharts("previewChart").dispose(); var chart_previewChart = new FusionCharts( { "swfUrl" : "pages/category/charts/FusionCharts/Pie3D.swf", "width" : "700", "height" : "400", "renderAt" : "previewChartDiv", "dataFormat" : "jsonurl", "id" : "previewChart", "dataSource" : "data/chart/preview/root$brands.json" } ).render();// --></script><!-- END Script Block for Chart previewChart --> The JSON file, looks like this: {"chart":{"showLabels":"1","showValues":"0","legendPosition":"BOTTOM","baseFontSize":"14","legendBorderAlpha":"0","legendShadow":"0","legendIconScale":"1","enableSmartLabels":"1","caption":"Show cases disturbed by Types","formatNumberScale":"0","showPercentInToolTip":"1","showLegend":"0"},"data":[{"label":"Event1","value":4,"link":"electronic"},{"label":"Game","value":2,"link":"games"},{"label":"Home & Garden","value":3,"link":"home__and__garden"}]} Thanks Share this post Link to post Share on other sites
bigz Report post Posted October 21, 2011 Hi, Any advance or updates? One more point which might help, we noticed that it happen when we use chrome. In IE & FF it works fine. Thanks Share this post Link to post Share on other sites
Atrhick Report post Posted December 23, 2011 (edited) First of all let me thank you guys for being so willing to help me out on this. here is the PHP Code i am using to <?php $ciqfy1 = "CIQFY"; $query_str1 = "SELECT DAY( date_day ), COUNT( afid_seller_name ) " . " FROM lead_partners_pages " . " WHERE afid_seller_name = '$ciqfy1' AND MONTH(date_day)=MONTH(NOW()) " . " GROUP BY DATE( date_day ) "; $result1 = mysql_query($query_str1) or die(mysql_error()); $row1 = mysql_fetch_array($result1); $strXML1 = "<graph yaxisname='Leads Generatd' canvasBorderColor='333333' numdivlines='4' divLineColor='333333' >"; $strXML1 .= "<dataset seriesname='Leads Generatd' color='AFD8F8' showValues='0'>"; foreach($row1 as $leads_generated1) { $chardollers1 = $leads_generated1['COUNT(afid_seller_name)']; //Iterate through each factory $the_row1 = $leads_generated1['date_day']; $strXML1 .= "<set name='" . $the_row1 . "' value='250'" . " />"; //Finally, close <graph> element } $strXML1 .= "</dataset>"; $strXML1 .= "<dataset seriesname='Leads Sold' color='F6BD0F' showValues='0'> "; $ciqfy2 = "CIQFY"; $query_str2 = "SELECT DAY( date_day ), COUNT( afid_seller_name ) " . " FROM lead_partners_pages " . " WHERE afid_seller_name = '$ciqfy2' AND MONTH(date_day)=MONTH(NOW()) " . " GROUP BY DATE( date_day ) "; $result2 = mysql_query($query_str2) or die(mysql_error()); $row2 = mysql_fetch_array($result2); foreach($row2 as $leads_generated2) { $chardollers2 = $leads_generated2['COUNT(afid_seller_name)']; //Iterate through each factory $the_row2 = $leads_generated1['date_day']; $strXML1 .= "<set name='" . $the_row2 . "' value='250'" . " />"; //Finally, close <graph> element } $strXML1 .= "</dataset>"; $strXML1 .= "</graph>"; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("../../admin/FusionCharts/FCF_StackedColumn2D.swf", "", $strXML1, "leads_gen_and_sold", 855, 320,"dataFormat"); ?> here is the code it generates for the user. how the chart is showing but i don't see the accusal chat itself. I have also added an image for you to see. <!-- START Script Block for Chart leads_gen_and_sold --> <div id="leads_gen_and_soldDiv" align="center"> Chart. </div> <script type="text/javascript"> //Instantiate the Chart var chart_leads_gen_and_sold = new FusionCharts("../../admin/FusionCharts/FCF_StackedColumn2D.swf", "leads_gen_and_sold", "855", "320", "1", "0"); chart_leads_gen_and_sold.setTransparent("false"); //Provide entire XML data using dataXML method chart_leads_gen_and_sold.setDataXML(" <graph yaxisname='Leads Generatd' canvasBorderColor='333333' numdivlines='4' divLineColor='333333' > <dataset seriesname='Leads Generatd' color='AFD8F8' showValues='0'> <set name='1' value='250' /> <set name='1' value='250' /> <set name='2' value='250' /> <set name='2' value='250' /> </dataset> <dataset seriesname='Leads Sold' color='F6BD0F' showValues='0'> <set name='2' value='250' /> <set name='2' value='250' /> <set name='2' value='250' /> <set name='2' value='250' /> </dataset> </graph>a ") //Finally, render the chart. chart_leads_gen_and_sold.render("leads_gen_and_soldDiv"); </script> <!-- END Script Block for Chart leads_gen_and_sold --> Edited December 23, 2011 by Atrhick Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 26, 2011 Hi, Welcome to FusionCharts Forum! It seems from your code and image that you are using the FusionCharts free version, not FusionCharts XT (v 3.2.2.) FusionCharts free is a completely different product from FusionCharts XT with a huge difference in terms of features. Could you please download the latest version of FusionCharts from: http://www.fusioncharts.com/download/trials/ ? Hope this helps. Share this post Link to post Share on other sites