title: index.php:212 Uncaught ReferenceError: FusionCharts is not defined
body: <p>i want to retrieve data from mysql database into bar chart using Fusion chart. but i get this error when try to debug with console log (ctrl+shift+j in chrome):
  index.php:212 Uncaught ReferenceError: FusionCharts is not defined</p>
  
  <p>here is my code so far</p>
  
  <pre><code>&lt;?php
                              include "../../koneksi.php";
                              //require_once __DIR__ . '/fusioncharts.php';
                              include "fusioncharts.php";
  
                          // Form the SQL query that returns the top 10 most populous countries
                            $strQuery = mysql_query("select calType, count(cal_num) as count from calequipment Group By CalType order by calType desc");
  
                            // If the query returns a valid response, prepare the JSON string
                            if ($strQuery) {
                              // The `$arrData` array holds the chart attributes and data
                              $arrData = array(
                                "chart" =&gt; array(
                                    "caption" =&gt; "Calibration Type",
                                    "paletteColors" =&gt; "#0075c2",
                                    "bgColor" =&gt; "#ffffff",
                                    "borderAlpha"=&gt; "20",
                                    "canvasBorderAlpha"=&gt; "0",
                                    "usePlotGradientColor"=&gt; "0",
                                    "plotBorderAlpha"=&gt; "10",
                                    "showXAxisLine"=&gt; "1",
                                    "xAxisLineColor" =&gt; "#999999",
                                    "showValues" =&gt; "0",
                                    "divlineColor" =&gt; "#999999",
                                    "divLineIsDashed" =&gt; "1",
                                    "showAlternateHGridColor" =&gt; "0"
                                  )
                              );
  
                              $arrData["data"] = array();
  
                              // Push the data into the array
                              while($row = mysql_fetch_assoc($strQuery)) {
                                array_push($arrData["data"], array(
                                    "label" =&gt; $row["calType"],
                                    "value" =&gt; $row["count"]
                                    )
                                );
                              }
  
                              /*JSON Encode the data to retrieve the string containing the JSON representation of the data in the array. */
  
                              $jsonEncodedData = json_encode($arrData);
  
                              /*Create an object for the column chart using the FusionCharts PHP class constructor. Syntax for the constructor is ` FusionCharts("type of chart", "unique chart id", width of the chart, height of the chart, "div id to render the chart", "data format", "data source")`. Because we are using JSON data to render the chart, the data format will be `json`. The variable `$jsonEncodeData` holds all the JSON data for the chart, and will be passed as the value for the data source parameter of the constructor.*/
  
                              $columnChart = new FusionCharts("Pie3D", "myFirstChart" , 600, 300, "chart-1", "json", $jsonEncodedData);
  
                              // Render the chart
                              $columnChart-&gt;render();
  
                            }
                          ?&gt;
  </code></pre>
  
  <p>the error said in line 212 and line 217. this the code :</p>
  
  <pre><code>212. &lt;div class="panel panel-default"&gt;
  217. &lt;?php
  </code></pre>
  
  <p>its not make sense so i feel confused</p>
  
  <p>i sure that the path includes correctly. please anyone help me. every suggestion would be appreciate thanks :)</p>
  
  <p>edit:
  i got something different between my php file and console log file. i mean when i try to see the code in console log, the error is in this code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          FusionCharts.ready(function () {
              new FusionCharts({"type":"Pie3D","id":"myFirstChart","width":600,"height":300,"renderAt":"chart-1","dataFormat":"json","dataSource":{"chart":{"caption":"Calibration Type","paletteColors":"#0075c2","bgColor":"#ffffff","borderAlpha":"20","canvasBorderAlpha":"0","usePlotGradientColor":"0","plotBorderAlpha":"10","showXAxisLine":"1","xAxisLineColor":"#999999","showValues":"0","divlineColor":"#999999","divLineIsDashed":"1","showAlternateHGridColor":"0"},"data":[{"label":"Internal","value":"1"},{"label":"External","value":"2"}]}});
          });
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          FusionCharts.ready(function () {
              FusionCharts("myFirstChart").render();
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>but that code is very different with my php file when i open in notepad++</p>