title: All series on a given axis must be of the same data type
body: <p>I early had problems with formatting the time, but now having problem with showing the google chart visualiszation out of this error: All series on a given axis must be of the same data type.</p>
  
  <p>This is the goal, with date and time: <a href="http://jsbin.com/yaqew/1/edit" rel="nofollow noreferrer">http://jsbin.com/yaqew/1/edit</a></p>
  
  <p>As I have been notified the google chart constructor will not accept the time/date string: <a href="https://developers.google.com/chart/interactive/docs/reference#dataparam" rel="nofollow noreferrer">https://developers.google.com/chart/interactive/docs/reference#dataparam</a></p>
  
  <p>Database: </p>
  
  <p><img src="https://i.stack.imgur.com/ptaYb.png" alt="enter image description here"></p>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  
      $con=mysql_connect("localhost","root","") or die("Failed to connect with database!!!!");
      mysql_select_db("chart", $con);
  
      $sth = mysql_query("SELECT * FROM googlechart");
  
      $rows = array();
      //flag is not needed
      $flag = true;
      $table = array();
  
      $table['cols'] = array(
  
      array('label' =&gt; 'Time', 'type' =&gt; 'datetime'),
      array('label' =&gt; 'Date', 'type' =&gt; 'datetime'),
      array('label' =&gt; 'PH',      'type' =&gt; 'number'),
      array('label' =&gt; 'temperature','type' =&gt; 'number'), 
      array('label' =&gt; 'Chlorine','type' =&gt; 'number'),
      );
  
      $rows = array();
  
      while($r = mysql_fetch_assoc($sth)) {
  
      // assumes dates are in the format "yyyy-MM-dd"
      $dateString = $r['Date'];
      $dateArray = explode('-', $dateString);
      $year = $dateArray[0];
      $month = $dateArray[1] - 1; // subtract 1 to convert to javascript's 0-indexed months
      $day = $dateArray[2];
  
      echo $dateString."&lt;br&gt;";
  
      // assumes time is in the format "hh:mm:ss"
      $timeString = $r['Time'];
      $timeArray = explode(':', $timeString);
      $hours = $timeArray[0];
      $minutes = $timeArray[1];
      $seconds = $timeArray[2];
  
      echo $timeString;
  
      $temp = array();
      $temp[] = array('v' =&gt; "Date($year, $month, $day, $hours, $minutes, $seconds)"); 
      $temp[] = array('v' =&gt; (string) $r['PH']);
      $temp[] = array('v' =&gt; (string) $r['temperature']);
      $temp[] = array('v' =&gt; (string) $r['Chlorine']);
  
      $rows[] = array('c' =&gt; $temp);
  
      }
  
      $table['rows'] = $rows;
      $jsonTable = json_encode($table);
      /* echo $jsonTable; */  
  
  ?&gt;
  </code></pre>
  
  <p>Html/Javascript:</p>
  
  <pre><code>&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);
  
        function drawChart() {
          var data = new google.visualization.DataTable(&lt;?=$jsonTable?&gt;);
  
  
  
          var options = {
          /*width: 900, height: 900, */
            title: 'Visualization',
            curveType: 'function', 
             legend: { position: 'bottom' },
             pointSize: 12,
          vAxis: {title: "Values", titleTextStyle: {italic: false}},
          hAxis: {title: "Time", titleTextStyle: {italic: false}},
          explorer: { 
                  actions: ['dragToZoom', 'rightClickToReset'], 
                  axis: 'vertical'
              }
  
  
          };
  
          var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
          chart.draw(data, options);
  
  
        }
  </code></pre>