HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// prepare data for the chart
3
var data = [
4
{ name: 'Application', value: 100 },
5
{ name: 'Brief Interview by HR', value: 70 },
6
{ name: 'Testing', value: 57 },
7
{ name: 'Revealing some other information', value: 38 },
8
{ name: 'Interview with the director', value: 15 },
9
{ name: 'Offer', value: 10 }
10
];
11
12
// create funnel chart
13
var chart = anychart.funnel(data);
14
15
// set chart background color
16
chart.background('white');
17
18
// set chart legend settings
19
chart.legend(true).padding().top(20);
20
21
// set chart title
22
chart
23
.title('Interviewing and recruiting')
24
// set chart base width settings
25
.baseWidth('70%')
26
// set the neck height
27
.neckHeight('0%');
28
29
// set chart labels settings
30
chart.labels().position('outside-left').format('{%Name} - {%Value}%');
31
32
// set container id for the chart
33
chart.container('container');
34
35
// initiate chart drawing
36
chart.draw();
37
});