title: Data column(s) for axis #0 cannot be of type string - Google Charts
body: <p>I'm trying to display some data in Google Charts but get this error:</p>
  <pre><code>Data column(s) for axis #0 cannot be of type string..
  </code></pre>
  <p>I have two properties from this class:</p>
  <pre><code>public class GAStatistics
  {
      public string Date { get; set; }
      public string Visitors { get; set; }
  }
  </code></pre>
  <p>I'm passing this a list of these properties from this controller:</p>
  <pre><code>public class GAStatisticsController : Controller
  {
      
       //GET: /ShopStatistics/
  
  
      public ActionResult GetData()
      {
          return Json(CreateCompaniesList(), JsonRequestBehavior.AllowGet);
      }
  
  
      private IEnumerable&lt;GAStatistics&gt; CreateCompaniesList()
      {
          
          List&lt;GAStatistics&gt; ListGaVisitors = new List&lt;GAStatistics&gt;();
  
          foreach (var row in d.Rows)
          {
  
              GAStatistics GaVisits = new GAStatistics(row[0], row[1]);
              ListGaVisitors.Add(GaVisits);
          }
          
  
          return ListGaVisitors;
     
      }
  
  }
  </code></pre>
  <p>To this view of which I pass the list from the controller:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;https://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
      
      &lt;script type=&quot;text/javascript&quot;&gt;
      
          google.load(&quot;visualization&quot;, &quot;1&quot;, { packages: [&quot;corechart&quot;] });
          google.load(&quot;visualization&quot;, &quot;1&quot;, { packages: [&quot;treemap&quot;] });
          google.setOnLoadCallback(drawChart);
          function drawChart() {
              $.get('/GAStatistics/GetData', {},
                  function (data) {
                      var tdata = new google.visualization.DataTable();
      
                      tdata.addColumn('string', 'Date');
                      tdata.addColumn('string', 'Visitors');
              
      
                      for (var i = 0; i &lt; data.length; i++) {
                          //tdata.addRow([data[i].Year, data[i].Salary, data[i].Expense]);
                          tdata.addRow([data[i].Date, data[i].Visitors]);
                      }
      
      
      
                      var options = {
                          title: &quot;Expenses, salary For the current year&quot;
                      };
      
                      var chart1 = new google.visualization.AreaChart(document.getElementById('chart_div1'));
      
                      chart1.draw(tdata, options);
  
                  });
      
      
          }
      &lt;/script&gt;
  </code></pre>
  <p>Any idea?</p>