I want to compare the data for the same dates but different years.
For example, for the date January 1, I want to display the data for 2016 and 2015 on the same chart, same position on the x-axis but on different line series.
Is this possible?
I want to compare the data for the same dates but different years.
For example, for the date January 1, I want to display the data for 2016 and 2015 on the same chart, same position on the x-axis but on different line series.
Is this possible?
here is an example of the chart, I think you are describing...
google.charts.load('current', {
callback: function () {
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', '2005');
data.addColumn('number', '2006');
data.addRows([
[new Date('01/01/2016'), 200, 210],
[new Date('01/02/2016'), 190, 220],
[new Date('01/03/2016'), 205, 200],
[new Date('01/04/2016'), 220, 230],
[new Date('01/05/2016'), 212, 210],
[new Date('01/06/2016'), 185, 193],
[new Date('01/07/2016'), 196, 207]
]);
var options = {
height: 400
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
},
packages: ['corechart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>