title: AmCharts Error: Uncaught TypeError: Cannot read property 'graphs' of undefined
body: <p>This is my first question on stackoverflow.</p>
  
  <p>I'm trying to render a serial chart through an onclick event. (Please see a JSfiddle - <a href="http://jsfiddle.net/w408kcmp/" rel="nofollow">http://jsfiddle.net/w408kcmp/</a> ).</p>
  
  <p>JS:</p>
  
  <pre><code>var expIConfig;
  var expIData = [{
      "period": "Week 1",
          "inflows": 5,
          "outflows": 10
  }];
  
  expIConfig = {
      "type": "serial",
          "theme": "none",
          "dataProvider": expIData,
          "startDuration": 1,
          "colors": ['#77ED84', '#FA6F0C'],
          "graphs": [{
          "balloonText": "Inflows during [[category]]: &lt;b&gt;[[value]]&lt;/b&gt;",
              "fillAlphas": 0.9,
              "lineAlpha": 0.2,
              "title": "Inflows",
              "type": "column",
              "valueField": "inflows"
      }, {
          "balloonText": "Outflows during [[category]]: &lt;b&gt;[[value]]&lt;/b&gt;",
              "fillAlphas": 0.9,
              "lineAlpha": 0.2,
              "title": "Outflows",
              "type": "column",
              "clustered": false,
              "columnWidth": 0.5,
              "valueField": "outflows"
      }],
          "plotAreaFillAlphas": 0.1,
          "categoryField": "period",
          "categoryAxis": {
          "gridPosition": "start",
              "labelRotation": 25
      }
  };
  
  function renderChart() {
      expIConfig.dataProvider = expIData;
      expIChart = AmCharts.makeChart("chartdiv1", expIConfig, expIData);
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;button onclick="renderChart()"&gt;Render&lt;/button&gt;
  &lt;div id="chartdiv1" style="width:300px;height:325px;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Resources:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://www.amcharts.com/lib/3/amcharts.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://www.amcharts.com/lib/3/serial.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://www.amcharts.com/lib/3/themes/none.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I'm getting the above error. Others with similar issues (not amCharts related indicated it might be due to amcharts.js loading after serial.js, however, my scripts are loading in the specified order: amcharts.js -> serial.js -> none.js.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Many thanks.</p>