HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
// add the data
4
var data = anychart.data.set([
5
["Wimbledon", 8],
6
["Australian Open", 6],
7
["U.S. Open", 5],
8
["French Open", 1]
9
]);
10
11
// create a pie chart instance with the passed data
12
var chart = anychart
13
.pie(data)
14
// set the inner radius to make a donut chart
15
.innerRadius("55%");
16
17
// set the chart title
18
chart.title("Grand Slam Titles Won by Roger Federer");
19
20
// set the container id for the chart
21
chart.container("container");
22
23
// draw the resulting chart
24
chart.draw();
25
26
});