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
normal: { hatchFill: {
8
type: "forward-diagonal",
9
color: "#669999"
10
}
11
},
12
hovered: { hatchFill: {
13
type: "forward-diagonal",
14
color: "#669999",
15
thickness: 3
16
}
17
}
18
},
19
{x: "C", value: 148662},
20
{x: "D", value: 78662},
21
{x: "E", value: 90000}
22
];
23
24
// create a chart and set the data
25
var chart = anychart.pie(data);
26
27
// configure the states of the chart
28
chart.normal().fill("#669999", 0.5);
29
chart.hovered().fill("#669999", 0.3);
30
chart.normal().stroke("#669999", 3);
31
chart.hovered().stroke("#669999", 3);
32
33
// set the chart title
34
chart.title("States: Single-Series Chart");
35
36
// set the container id
37
chart.container("container");
38
39
// initiate drawing the chart
40
chart.draw();
41
});