Stacked column charts
Привет! Есть диаграмма - http://codepen.io/WebCodePro/pen/cdabo
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['API Category', 'Social', 'Music', 'File Sharing', 'Storage',
'Weather', { role: 'annotation' } ],
['2011', 98, 53, 12, 16, 6, ''],
['2012', 151, 34, 26, 36, 49, ''],
['2013', 69, 27, 22, 17, 15, ''],
]);
var options = {
width: 1000,
height: 550,
legend: { position: 'top', maxLines: 3, textStyle: {color: 'black', fontSize: 16 } },
isStacked: true,
// Displays tooltip on selection.
// tooltip: { trigger: 'selection' },
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, options);
// Selects a set point on chart.
// chart.setSelection([{row:0,column:1}])
// Renders chart as PNG image
// chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
}
Тут описание - https://developers.google.com/chart/interactive/docs/gallery/columnchart
Как сделать так, чтобы получилось, как на этой картинке:
Источник: Stack Overflow на русском