title: How to assign javascript variable to amcharts dataloader?
body: <p>I need to assign a javascript variable to amcharts dataloader. but following code does not work (Graph does not draw) </p>
  
  <pre><code>AmCharts.ready(function () {
  
      var data = [{"employee_no": "101","Salary": "1000"},{"employee_no": "102","Salary": "1500"},{"employee_no": "103","Salary": "1100"},{"employee_no": "104","Salary": "1900"},{"employee_no": "105","Salary": "1200"},
      {"employee_no": "106","Salary": "1800"},{"employee_no": "107","Salary": "2000"},{"employee_no": "108","Salary": "1500"}];
  
      var chart = new AmCharts.AmSerialChart();
      chart.dataLoader = data;
      chart.categoryField = "employee_no";
  
      var graph = new AmCharts.AmGraph();
      graph.valueField = "Salary";
      graph.type = "line";
      graph.bullet = "round";
      graph.lineColor = "#8d1cc6";
  
      chart.addGraph(graph);
  
      chart.write('chartdiv');
  
      });
  </code></pre>
  
  <p>but if I use below code it works fine.</p>
  
  <pre><code>  chart.dataLoader = {
              url: "MY_URL",
              postProcess: function (data, options) {
                  if (data === null) {
                      data = [];
                      options.chart.addLabel("50%", "50%", "No Data Available");
                  }
                  return data;
              }
          };
  </code></pre>
  
  <p>What is the error of above code ? I cannot figure it out.</p>
  
  <p>Thanks you</p>