title: ASP.Net MVC - Json data for Google Charts
body: <p>Newbie to Google Charts, I am trying to create a Google Chart, controller returns JSON data like</p>
  
  <pre><code>{"data":[["In Progress","10"],["Completed","20"],["Deleted","5"],["Overdue","8"]]}
  </code></pre>
  
  <p>But data required for Google chart should be like</p>
  
  <pre><code>[["In Progress",10],["Completed",20],["Deleted","5"],["Overdue",8]]
  </code></pre>
  
  <p>I have following JS function:</p>
  
  <pre><code>$(document).ready(function () {
          $.ajax({
              url: '@Url.Action("TaskStatus", "Graph")',
              data: "",
              dataType: "json",
              type: "POST",
              contentType: "application/json; chartset=utf-8",
              success: function (data) {                   
                  var jsonData = JSON.stringify(data);
  
                  var dt = new google.visualization.DataTable();
                  dt.addColumn('string', 'Tasks');
                  dt.addColumn('number', 'Count');
  
                  $.each(arrJson, function (i, obj) {
                      $.each(obj, function (i, o) {
                          console.log(o[1]);                            
                          dt.addRow(o[0],parseInt(o[1])); // here I get error of datatype for "Count" column
                      })                                              
                  })
                  chartData = dt;
              },
              error: function (err) {
                  alert(err);
                  console.log(err);
              }
          }).done(function () {
              drawChart();
          })
      })
  
  function drawChart()
  {           
  var options = {
                  width: '500px',
                  title: "Task Status",
                  pointSize: 20,
                  chartArea:{width:"100%",height:"100px"}
              };
          var pieChart = new google.visualization.PieChart(document.getElementById('chart_div'));
          pieChart.draw(chartData, options);
  }
  </code></pre>
  
  <p><strong>Controller returns</strong></p>
  
  <pre><code>List&lt;object&gt; temp = new List&lt;object&gt;();
              temp.Add(new[] { "In Progress", "10" });
              temp.Add(new[] { "Completed", "20" });
              temp.Add(new[] { "Deleted", "5" });
              temp.Add(new[] { "Overdue", "8" });
  
              return Json(new { data = temp });
  </code></pre>
  
  <p>Please advice how to fix this? Thanks a lot in advance!</p>