Рисование диаграммы с помощью API визуализации Google
gs:
function showChartDialog() {
var ui=HtmlService.createHtmlOutputFromFile('ah2').setHeight(500).setWidth(500);
SpreadsheetApp.getUi().showModelessDialog(ui, 'Chart')
}
html:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script>google.charts.load('current', {'packages':['corechart','bar']});</script>
</head>
<body>
<div id="cht"></div><input type="button" value="Draw" onClick="createSample();" />
<script>
function createSample(){
var data = new google.visualization.DataTable();
data.addColumn('date', "Date");
data.addColumn('timeofday', "A");
data.addColumn('timeofday', "B");
data.addRow([new Date(2020,2,22),[22,00,00],[22,00,00]]);
data.addRow([new Date(2020,2,23),[20,00,00],[20,00,00]]);
data.addRow([new Date(2020,2,24),[17,00,00],[17,00,00]]);
var options = {
title: 'Column Chart',
width: 600,
height: 400,
bar: { groupWidth: '75%' },
isStacked: true
};
var chart=new google.visualization.ColumnChart(document.getElementById('cht'));
chart.draw(data,options)
}
</script>
</body>
</html>