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 data
4
var data = [
5
{x: "A", value: 637166},
6
{x: "B", value: 721630},
7
{x: "C", value: 148662},
8
{x: "D", value: 78662},
9
{x: "E", value: 90000}
10
];
11
12
// create a chart and set the data
13
var chart = anychart.pie(data);
14
15
// configure the visual settings of the chart
16
chart.normal().fill("#669999", 0.5);
17
chart.hovered().fill("#666699", 0.5);
18
chart.selected().fill("#666699", 0.7);
19
chart.normal().hatchFill("forward-diagonal", "#669999");
20
chart.hovered().hatchFill(null);
21
chart.selected().hatchFill(null);
22
chart.normal().stroke("#669999", 2);
23
chart.hovered().stroke("#669999", 2);
24
25
// set the chart title
26
chart.title("Pie Chart: Appearance (Slices)");
27
28
// set the container id
29
chart.container("container");
30
31
// initiate drawing the chart
32
chart.draw();
33
});