HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
15
1
anychart.onDocumentReady(function () {
2
// To work with the data adapter you need to reference the data adapter script file from AnyChart CDN
3
// https://cdn.anychart.com/releases/8.13.0/js/anychart-data-adapter.min.js
4
5
anychart.data.loadGoogleSpreadsheet({key: '1vLGbBZoBDXVT3IaykMb4HhvfXgoAOzEM3Rrk1xLN5aU', sheet: 'obqmz8q'}, function(data) {
6
// the data from the sheet with 'obqmz8q' id is loaded into the "data" variable
7
// create a chart
8
var chart = anychart.pie();
9
// set data
10
chart.data(data);
11
// display a chart
12
chart.container('container');
13
chart.draw();
14
});
15
});