title: Google line chart : visualization library. Uncaught TypeError: Cannot call method 'arrayToDataTable' of undefined
body: <pre><code>&lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  google.load("visualization", "1", {packages: ["corechart"]});
  google.setOnLoadCallback(drawBarChart);
  
  function drawBarChart() {
      var data = google.visualization.arrayToDataTable([
      ['Subject Name', 'Correct', 'Wrong'],
      ['Four-digit Numbers', 1, 1],
      ['Substraction with Borrowing', 1, 0],
      ['Multiplication', 1, 0],
      ['Measures of Mass', 1, 0],
  ]);
  
      var view = new google.visualization.DataView(data);
      view.setColumns([0, 1,
                          { calc: "stringify",
                            sourceColumn: 1,
                            type: "string",
                            role: "annotation"
                          },
                          2,
                          { calc: "stringify",
                            sourceColumn: 2,
                            type: "string",
                            role: "annotation" }
      ]);
  
  
      var options = {
          title: 'No. of Right &amp; Wrong Questions',
          isStacked: true,
          legend: { position: 'top',alignment :'end' },
          chartArea: {width: '85%'},
          series: [
              {color:'#199EAF'},
              {color:'#BD2B53'}
          ]
  
      };
  
      var chart = new google.visualization.ColumnChart(document.getElementById("bar_1"));
      chart.draw(view, options);
  }
  </code></pre>
  
  <p></p>
  
  <p>I am getting the error Uncaught TypeError: Cannot call method 'arrayToDataTable' of undefined.
  Looks like the visualisation package is not getting initialised. What I am doing wrong here?   </p>