title: FusionCharts Not Working
body: <p>I'm new to the whole development arena. Could you please help me out in identifying the error in the following. I'm using FusionCharts for a school project and finding it difficult to populate the chart. I have created the files based on the tutorials provided but have included the element of MYSQL to retrieve data. The files are as follows, </p>
  
  <p>HTML...</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
       &lt;title&gt;Fusion Charts Column 2D Sample&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="chart-container"&gt;FusionCharts will render here&lt;/div&gt;
    &lt;script src="js/jquery-2.1.4.js"&gt;&lt;/script&gt;
    &lt;script src="js/fusioncharts.js"&gt;&lt;/script&gt;
    &lt;script src="js/fusioncharts.charts.js"&gt;&lt;/script&gt;
    &lt;script src="js/themes/fusioncharts.theme.zune.js"&gt;&lt;/script&gt;
    &lt;script src="js/app1.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>PHP...</p>
  
  <pre><code>&lt;?php
  //address of the server where db is installed
  $servername = "localhost";
  
  //username to connect to the db
  //the default value is root
  $username = "xyz";
  
  //password to connect to the db
  //this is the value you would have specified during installation of WAMP stack
  $password = "123";
  
  //name of the db under which the table is created
  $dbName = "test";
  
  //establishing the connection to the db.
  $conn = new mysqli($servername, $username, $password, $dbName);
  
  //checking if there were any error during the last connection attempt
  if ($conn-&gt;connect_error) {
    die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  //the SQL query to be executed
  $query = ("SELECT month, actuallikes, projected, profit FROM avp");
  
  //storing the result of the executed query
  $result = $conn-&gt;query($query);
  
  //initialize the array to store the processed data
  $jsonArray = array();
  
  //check if there is any data returned by the SQL Query
  if ($result-&gt;num_rows &gt; 0) {
    //Converting the results into an associative array
    while($row = $result-&gt;fetch_assoc()) {
      $jsonArrayItem = array();
      $jsonArrayItem['lable'] = $row['month'];
      $jsonArrayItem['value'] = $row['actuallikes'];
      $jsonArrayItem['value1'] = $row['projected'];
      $jsonArrayItem['value2'] = $row['profit'];  
      //append the above created object into the main array.
      array_push($jsonArray, $jsonArrayItem);
    }
  }
  
  //Closing the connection to DB
  $conn-&gt;close();
  
  //set the response content type as JSON
  header('Content-type: application/json');
  //output the return value of json encode using the echo function. 
  echo json_encode($jsonArray);
  ?&gt;
  </code></pre>
  
  <p>JavaScript...</p>
  
  <pre><code>var lables = [], values = [], value1s = [], value2s = [];
  function getusers() {
  
      $.ajax({
              type: 'GET',
              async: false,
              url: "http://localhost/avp/chart_data.php",
              data: {},
              dataType: "json",
              success: function(result){
                  if(result){
                      for(var i = 0 ; i &lt; result.length; i++){
                          lables.push(result[i].lable);
                          values.push(result[i].value);
                          value1s.push(result[i].value1);
                          value2s.push(result[i].value2);
                      }
                  }
              },
              error: function(errmsg) {
                  alert("Ajax??????????!"+ errmsg);
              }
          });
      return lables, values, value1s, value2s;
      }
  
      getusers();
  
   salesAnlysisChart = new FusionCharts({
      type: 'mscombi2d',
      renderAt: 'chart-container',
      width: '600',
      height: '300',
      dataFormat: 'json',
      dataSource: {
        "chart": {
          "caption": "Harry's SuperMart",
          "subCaption": "Sales analysis of last year",
          "xAxisname": "Month",
          "yAxisName": "Amount (In USD)",
          "numberPrefix": "$",
          "showBorder": "0",
          "showValues": "0",
          "paletteColors": "#0075c2,#1aaf5d,#f2c500",
          "bgColor": "#ffffff",
          "showCanvasBorder": "0",
          "canvasBgColor": "#ffffff",
          "captionFontSize": "14",
          "subcaptionFontSize": "14",
          "subcaptionFontBold": "0",
          "divlineColor": "#999999",
          "divLineIsDashed": "1",
          "divLineDashLen": "1",
          "divLineGapLen": "1",
          "showAlternateHGridColor": "0",
          "usePlotGradientColor": "0",
          "toolTipColor": "#ffffff",
          "toolTipBorderThickness": "0",
          "toolTipBgColor": "#000000",
          "toolTipBgAlpha": "80",
          "toolTipBorderRadius": "2",
          "toolTipPadding": "5",
          "legendBgColor": "#ffffff",
          "legendBorderAlpha": '0',
          "legendShadow": '0',
          "legendItemFontSize": '10',
          "legendItemFontColor": '#666666'
        },
        "categories": [{
          "category": lables
        }],
        "dataset": [{
          "seriesName": "Actual Revenue",
          "showValues": "1",
          "data": values
        }, {
          "seriesName": "Projected Revenue",
          "renderAs": "line",
          "data": value1s
        }, {
          "seriesName": "Profit",
          "renderAs": "area",
          "data": value2s
        }]
      }
    });
      salesAnlysisChart.render(); }
  });
  });
  </code></pre>
  
  <p>Hope someone could help me in spotting the error. Apologies if i have done anything stupid. </p>
  
  <p>Cheers!</p>