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
// create a stage
4
var stage = anychart.graphics.create("container");
5
6
// create data
7
var data = [
8
{x: "A", value: 637166},
9
{x: "B", value: 721630},
10
{x: "C", value: 148662},
11
{x: "D", value: 78662},
12
{x: "E", value: 90000}
13
];
14
15
// create and configure the first pie chart
16
var chart1 = anychart.pie(data);
17
chart1.title("Radius: Default");
18
chart1.bounds(0, 0, "50%", "100%");
19
// disable the legend
20
chart1.legend(false);
21
// set the chart container
22
chart1.container(stage);
23
// initiate drawing the chart
24
chart1.draw();
25
26
// create and configure the second pie chart
27
var chart2 = anychart.pie(data);
28
chart2.title("Radius: 30%");
29
chart2.bounds("50%", 0, "50%", "100%");
30
// set the radius
31
chart2.radius("30%");
32
// disable the legend
33
chart2.legend(false);
34
// set the chart container
35
chart2.container(stage);
36
// initiate drawing the chart
37
chart2.draw();
38
});