rock.huang Report post Posted July 18, 2013 After hiding the charter with javascript, i can't reload the charter when i try to show it. How to solve this problem? Share this post Link to post Share on other sites
Guest Sashibhusan Report post Posted July 18, 2013 Hi, Welcome to FusionCharts Forum. Could you please provide the code snippet of "how you are trying to hide/show the chart using JavaScript", so that we may better help you? Awaiting your valuable inputs. Share this post Link to post Share on other sites
rock.huang Report post Posted July 18, 2013 The charters are in <div id="chart_box" ></div>and i use a hide/show button to control it.the code as follows: $(document).ready(function(){ $("#show-chart-btn").click(function(){ if($(this).text()=='Hide') { $(this).text('Show'); $("#chart_box").hide(); } else { $(this).text('Hide'); $("#chart_box").show(); } }); }); After i hide the #chart_box and try to show it again. The flash charter show "invalid data." and the data lost.seem only in Firfox, IE is ok. Share this post Link to post Share on other sites
Sanjukta Report post Posted July 18, 2013 The charters are in <div id="chart_box" ></div> and i use a hide/show button to control it. the code as follows: $(document).ready(function(){ $("#show-chart-btn").click(function(){ if($(this).text()=='Hide') { $(this).text('Show'); $("#chart_box").hide(); } else { $(this).text('Hide'); $("#chart_box").show(); } }); }); After i hide the #chart_box and try to show it again. The flash charter show "invalid data." and the data lost. seem only in Firfox, IE is ok. Hi, We have been working on his issue. The core problem related to this issue is Flash Player is automatically removing all the externalInterface functions (for updating chart's data etc.) of the Flash chart when resized or it is hidden and shown again or in other certain similar situations. We have tried to over-write this situation by forcefully injecting all behaviors that Flash Player does automatically. However, we are unable to fix this as of now. Hence, for the time-being we have come up to the following work-around (considering that the code now renders the chart once and updates only the data in rest of the cases): Please always call chart.render() once when the externalInterface is missing. The code would be similar to this: if (typeof chart.ref.setDataXML != "function") { chart.render(); } chart.ref.setDataXML(xmlString); Please share your feedback on this. Awaiting your reply. Share this post Link to post Share on other sites
rock.huang Report post Posted July 19, 2013 Thanks for your reply, have solve the problem.Just change the execution sequence.render the charter first and set the xmlurl later.Before: this.myChart.setXMLUrl(flashVars.data_file);this.myChart.render(this.config.chartCont);Now: this.myChart.render(this.config.chartCont); this.myChart.setXMLUrl(flashVars.data_file); Tested on IE,OPEAR,CHROME,FIREFOX Share this post Link to post Share on other sites
Sanjukta Report post Posted July 19, 2013 Thanks for your reply, have solve the problem. Just change the execution sequence. render the charter first and set the xmlurl later. Before: this.myChart.setXMLUrl(flashVars.data_file); this.myChart.render(this.config.chartCont); Now: this.myChart.render(this.config.chartCont); this.myChart.setXMLUrl(flashVars.data_file); Tested on IE,OPEAR,CHROME,FIREFOX Hi, Glad that your issue is resolved. Happy FusionCharting! Share this post Link to post Share on other sites