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
{name: "Company A", children: [
6
{name: "Technical",
7
normal: {fill: "#ffad99"},
8
children: [
9
{name: "Team Leaders"},
10
{name: "Architects"},
11
{name: "Developers",
12
normal: {fill: "#dd2c00"},
13
selected: {fill: "#b32400"}
14
},
15
{name: "Testers"}
16
]},
17
{name: "Sales", children: [
18
{name: "Analysts"},
19
{name: "Executives"}
20
]},
21
{name: "HR"},
22
{name: "Management"}
23
]}
24
];
25
26
// create a chart and set the data
27
var chart = anychart.sunburst(data, "as-tree");
28
29
// set the chart title
30
chart.title().useHtml(true);
31
chart.title("Sunburst: Appearance (Individual Points)<br><br>" +
32
"<span style='font-size:12; font-style:italic'>" +
33
"Corporate Structure</span>");
34
35
// set the container id
36
chart.container("container");
37
38
// initiate drawing the chart
39
chart.draw();
40
});