JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.google.com/jsapi?.js"></script>
<div id="chart_div"></div>
JavaScript
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'Value');
data.addRows([
[new Date(2014, 2, 7), 50],
[new Date(2014, 2, 7), 60],
[new Date(2014, 2, 7), 40],
[new Date(2014, 2, 7), 30],
[new Date(2014, 2, 7), 70],
[new Date(2014, 2, 7), 40],
[new Date(2014, 2, 8), 60],
[new Date(2014, 2, 8), 20],
[new Date(2014, 2, 8), 40]
]);
var dateFormatter = new google.visualization.DateFormat({pattern: 'dd MMM'});
var view = new google.visualization.DataView(data);
view.setColumns([{
type: 'string',
label: data.getColumnLabel(0),
calc: function (dt, row) {
return dateFormatter.formatValue(dt.getValue(row, 0));
}
}, 1]);
var chart = new google.visualization.LineChart(document.querySelector('#chart_div'));
chart.draw(view, {
height: 400,
width: 600
});
};
google.load('visualization', '1', {packages:['corechart'], callback: drawChart});