title: amCharts: How to gracefully manage lack of data from dataLoader
body: <p>I am using amCharts to generate graphs and such by pulling data via dataLoader capability.</p>
  
  <p>I have been mulling my brain as to how to gracefully handle lack of data that gets passed from API from time to time so that graph shows a message such as "No Data Available".</p>
  
  <p>Example chart code:</p>
  
  <pre><code>var chart = new AmCharts.AmSerialChart();
  
  chart.dataLoader = { url: "/api/blobs"};
  chart.categoryField = "site";
  chart.type="serial";
  chart.theme = "light";
  
  var graph = new AmCharts.AmGraph();
  graph.valueField = "visit";
  graph.type = "column";
  graph.fillAlphas = 1;
  graph.lineAlpha = 0;
  
  var valuesAxis = new AmCharts.ValueAxis();
  valuesAxis.integersOnly = true;
  
  graph.balloonText = "[[category]]: &lt;b&gt;Total: [[value]]&lt;/b&gt;";
  chart.depth3D = 45;
  chart.angle = 45;
  chart.addGraph(graph);
  chart.addValueAxis(valuesAxis);
  
  chart.write("blob_chart"); 
  </code></pre>
  
  <p>Anyone have a clue how I can manage to check if dataLoader returns null and if so write a plan "No Data Available" on the chart instead?</p>