title: Passing a javascript variable into a fusion chart constructor
body: <p>Everything works except getting the data to load in the chart.  When I view page source it shows ajaxData instead of the array of data that the variable contains.</p>
  
  <p>I've tried JSON.Stringify, this., and a few other methods.  I can't find any examples on the fusion chart website of loading data with AJAX, all their examples involve putting the javascript in server side code such as PHP, which is something I'd rather avoid.  I'd simply like to load data with ajax and dump it in the chart.</p>
  
  <pre><code>$.ajax($assetsSearchUrl, {
          dataType: "text",
          accepts: {text: "application/json"},
          success: loadChart
      });
  
  function loadChart(ajaxData)
  {        
  
      var ageGroupChart = new FusionCharts({
          type: 'pie2d',
          renderAt: 'chartId',
          width: '400',
          height: '275',
          dataFormat: 'json',
          theme: 'ocean',
          dataSource: {
              "chart": {
                  "caption": "Assets",
                  ....
                  "showLegend": "0"
          },
          data : ajaxData
      }
  }).render();
  }   
  </code></pre>
  
  <p>A working example without dynamic data.</p>
  
  <pre><code>FusionCharts.ready(function () {
  var ageGroupChart = new FusionCharts({
      type: 'pie2d',
      renderAt: 'chart-container',
      width: '450',
      height: '300',
      dataFormat: 'json',
      dataSource: {
          "chart": {
              "caption": "Split of Visitors by Age Group",
              ....
              "legendItemFontColor": '#666666'
          },
          "data": [
              {
                  "label": "Teenage",
                  "value": "1250400"
              }, 
              {
                  "label": "Senior",
                  "value": "491000"
              }
          ]
      }
  }).render();
  });
  </code></pre>