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
18
1
anychart.onDocumentLoad(function () {
2
// create an instance of a pie chart
3
var chart = anychart.pie();
4
// set the data
5
chart.data([
6
["Chocolate", 5],
7
["Rhubarb compote", 2],
8
["Crêpes Suzette", 2],
9
["American blueberry", 2],
10
["Buttermilk", 1]
11
]);
12
// set chart title
13
chart.title("Top 5 pancake fillings");
14
// set the container element
15
chart.container("container");
16
// initiate chart display
17
chart.draw();
18
});