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
// create pie chart
3
var chart = anychart.pie();
4
5
// set chart title
6
chart.title('Top 10 Cosmetic Products by Revenue');
7
8
// set chart data
9
chart.data([
10
{x: 'Rouge', value: 80540},
11
{x: 'Foundation', value: 94190},
12
{x: 'Mascara', value: 102610},
13
{x: 'Lip gloss', value: 110430},
14
{x: 'Pomade', value: 128000}
15
]);
16
17
// set container id for the chart
18
chart.container('container');
19
20
// initiate chart drawing
21
chart.draw();
22
});