The real question is how do I populate a Google charts datatable form a MySql query when a date is used for the first column?
I am trying to create a column chart using the Google Charts API. The problem is that the data is time series data. There are many dates represented. The way that this is done to create the data table is to assign column 0 to the date and each subsequent column represents the data being measured. That information is derived from the documentation. I just can't figure out how to get the data to assign to the subsequent columns. I have researched this extensively now and there are some answers that are close, but I can't make them work for this. Here is the code that is currently generating my chart data table:
$invArr = array('cols' => array(
array('label' => 'date', 'type' => 'date'),
array('label' => 'SKU', 'type' => 'number')),
'rows' => array());
while($row = mysql_fetch_row($query)) {
$invArr['rows'][] = array('c' => array(array('v' => $row[0]), array('v' => $row[1])));
}
I understand from the Google charts documentation that column 0 is always the date for continuous data. Each subsequent column is the data that is being measured, in this case ths SKU numbers. I need to have the first array in each row represent the date and the subsequent arrays represent the qtyoh data. I don't know how to do that.