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
x
1
anychart.onDocumentReady(function () {
2
3
// set chart type and data
4
var chart = anychart.pie([
5
["Department Stores", 637166],
6
["Discount Stores", 721630],
7
["Men's/Women's Stores", 148662],
8
["Juvenile Specialty Stores", 78662],
9
["All other outlets", 90000]
10
]);
11
// set chart title text settings
12
chart.title("Aqua Style");
13
14
// disable legend
15
chart.legend(false);
16
17
// set aqua style
18
chart.fill("aquastyle");
19
20
// text formatter
21
var labels = chart.labels();
22
labels.format(function() {
23
return((this.getData("value"))+"(of "+this.getStat("sum")+")");
24
});
25
26
// labels positioning
27
labels.position("outside");
28
29
// draw
30
chart.container("container");
31
chart.draw();
32
});