geebee Report post Posted April 17, 2011 Trying to call a $.ajax function to render chart. Here is the code when I click the button: $("#myAjaxChartButton").live('click',function(){ var strURL = "/MyFCPHPClassCharts/Charts/FirstAjaxChart.php"; $.ajax({ type: "GET", url: strURL, success: function(msg){ $("#chartContainer").show().html(msg); } }); }); the FristAjaxChart.php : <?php include('../Class/FusionCharts_Gen.php'); # Create Column3D chart Object $FC = new FusionCharts("Line2D","300","250"); # set the relative path of the SWF file $FC->setSWFPath("../FusionCharts/"); # Set chart attributes $strParam="caption=Weekly Sales;xAxisName=Week;yAxisName=Revenue;numberPrefix={:content:}quot;; $FC->setChartParams($strParam); # add chart values and category names $FC->addChartData("40800","label=Week 1"); $FC->addChartData("31400","label=Week 2"); $FC->addChartData("26700","label=Week 3"); $FC->addChartData("54400","label=Week 4"); ?> <script language='javascript' src="MyFCPHPClassCharts/FusionCharts/FusionCharts.js"></script> <?php # Render Chart $FC->renderChart(); ?> ********************************************************** All I get is a brief flash of the word "Chart." appear in the place where I want the chart to appear. What am I missing? PS This is just to test how I am supposed to render vis Ajax - so the code is very basic. Later I will build the details. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted May 6, 2011 Hi, You might not have loaded the FusionCharts.js in the main PHP file. Please check. Share this post Link to post Share on other sites