title: Rails + charts.js: How to fill out the Javascript array with value from database?
body: <p>I would like to use Google visualization charts for displaying information into a graph.</p>
  
  <p>The javascript function for setting value into the graph looks like this:</p>
  
  <pre><code>function drawLineChart(chartType) {
  
      if(chartType == undefined) {
          chartType = 'data1';
      }
  
      var data = {
          data1: [
              ['Year', 'Sales', 'Expenses'],
              ['2004',  1000,      400],
              ['2005',  1170,      460],
              ['2006',  660,       1120],
              ['2007',  1030,      540]
          ]
      };
  
      ...
  }
  </code></pre>
  
  <p>My problem is, that I don't know how to fill out array like this with values from database - any tip?</p>
  
  <p>Thanks a lot</p>