title: Google Charts Javascript, using two arrays for data input for a line chart
body: <p>I am trying to create a line chart using the Google Charts package. The problem I have is that I want to plot data from two Javascript arrays. I did find some code showing how to do this for a barchart, but I can not get the same code to work for creating a line chart. This is the code I have so far.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  
    &lt;!--Load the AJAX API--&gt;
    &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(drawChart);
  
  
      var time = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
      var suseptible = [0, 4, 5, 2, 6, 7, 3, 9, 9, 9];
  
      function drawChart(){
  
          var data = google.visualization.arrayToDataTable();
          data.addColumn('number', 'Time');
          data.addColumn('number', 'Suseptible');
  
          for(var i=0; i &lt; time.length; i++){
              var row = [time[i], suseptible[i]];
              data.addRow(row);
          }
  
  
  
          var options = {
  
          };
  
          var chart = new  google.visualization.LineChart(document.getElementById('chart_id'));
          chart.draw(data, options);
      }
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;!--Div that will hold the pie chart--&gt;
  &lt;div id="chart_id"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Can anyone explain the basics for how to do this. I have been looking in the Google Charts documentation, but I am having a hard time solving this.</p>