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: "Pacman", value: 400,
6
normal: {
7
fill: "#ffff00",
8
hatchFill: "percent50"
9
},
10
hovered: {
11
fill: "#ffff00",
12
hatchFill: "percent50",
13
outline: {
14
enabled: true,
15
width: 6,
16
fill: "#404040",
17
stroke: null
18
}
19
},
20
selected: {
21
outline: {
22
enabled: true,
23
width: 6,
24
fill: "#404040",
25
stroke: null
26
}
27
}
28
},
29
{x: "Not Pacman", value: 130,
30
normal: {fill: "#404040"},
31
hovered: {
32
fill: "#404040",
33
outline: {
34
enabled: false
35
}
36
},
37
selected: {outline: {enabled: false}}
38
}
39
];
40
41
// create a chart and set the data
42
var chart = anychart.pie(data);
43
44
// set the start angle
45
chart.startAngle(130);
46
47
// set the chart title
48
chart.title("Pie Chart: Appearance (Individual Points)");
49
50
// disable labels
51
chart.labels(false);
52
53
// set the container id
54
chart.container("container");
55
56
// initiate drawing the chart
57
chart.draw();
58
});