$(document).ready(function() {

  function drawCharts() {
    $('[data-chart-id]').each(function() {
      drawChart(this);
    });
  }

  function drawChart(chartElement) {
    var options = $(chartElement).data('chart-options');
    var chartId = $(chartElement).data('chart-id');

    var dataText = $('#' + chartId).text();
    var data = JSON.parse(dataText);

      var dataTable = new google.visualization.DataTable();

      var types = [];

      for (var i = 0; i < data.cols.length; i++) {
        var col = data.cols[i];
        types.push(col[0]);
        dataTable.addColumn(col[0], col[1]);
      }

      for (var i = 0; i < data.rows.length; i++) {
        var row = data.rows[i];
        var formattedRow = [];
        for (var j = 0; j < row.length; j++) {
          switch (types[j]) {
            case 'datetime':
              formattedRow.push(new Date(row[j]));
              break;
            default:
              formattedRow.push(row[j]);
          }
        }

        dataTable.addRow(formattedRow);
      }

      var chart = new google.visualization.LineChart(chartElement);
      chart.draw(dataTable, options);
  }

  google.setOnLoadCallback(drawCharts);

});
@@ -359,26 +359,24 @@
 Text);%0A%0A    
-  
 var dataTabl
@@ -418,26 +418,24 @@
 ble();%0A%0A    
-  
 var types = 
@@ -439,18 +439,16 @@
  = %5B%5D;%0A%0A
-  
     for 
@@ -490,26 +490,24 @@
 ++) %7B%0A      
-  
 var col = da
@@ -524,18 +524,16 @@
 ;%0A      
-  
 types.pu
@@ -540,26 +540,24 @@
 sh(col%5B0%5D);%0A
-  
       dataTa
@@ -587,31 +587,27 @@
 ol%5B1%5D);%0A    
-  
 %7D%0A%0A
-  
     for (var
@@ -639,26 +639,24 @@
 gth; i++) %7B%0A
-  
       var ro
@@ -675,26 +675,24 @@
 s%5Bi%5D;%0A      
-  
 var formatte
@@ -702,18 +702,16 @@
 w = %5B%5D;%0A
-  
       fo
@@ -755,18 +755,16 @@
         
- 
- 
 switch (
@@ -771,26 +771,24 @@
 types%5Bj%5D) %7B%0A
-  
           ca
@@ -806,34 +806,32 @@
 e':%0A            
-  
 formattedRow.pus
@@ -867,19 +867,15 @@
     
- 
- 
 break;%0A
-  
     
@@ -889,18 +889,16 @@
 efault:%0A
-  
         
@@ -940,14 +940,10 @@
     
- 
- 
 %7D%0A
-  
     
@@ -943,26 +943,24 @@
  %7D%0A      %7D%0A%0A
-  
       dataTa
@@ -985,31 +985,27 @@
 edRow);%0A    
- 
- 
 %7D%0A%0A
-  
     var char
@@ -1058,18 +1058,16 @@
 ement);%0A
-  
     char

Fix indentation