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
var data = [
3
{
4
x: 'East Europe',
5
low: 1,
6
q1: 5,
7
median: 8,
8
q3: 12,
9
high: 16
10
},
11
{
12
x: 'West Europe',
13
low: 1,
14
q1: 7,
15
median: 10,
16
q3: 17,
17
high: 22
18
},
19
{
20
x: 'Australia',
21
low: 1,
22
q1: 8,
23
median: 12,
24
q3: 19,
25
high: 26
26
},
27
{
28
x: 'South America',
29
low: 2,
30
q1: 8,
31
median: 12,
32
q3: 21,
33
high: 28
34
},
35
{
36
x: 'North America',
37
low: 3,
38
q1: 10,
39
median: 17,
40
q3: 28,
41
high: 30
42
},
43
{
44
x: 'Oceania',
45
low: 1,
46
q1: 9,
47
median: 16,
48
q3: 22,
49
high: 24
50
},
51
{
52
x: 'North Africa',
53
low: 1,
54
q1: 8,
55
median: 14,
56
q3: 18,
57
high: 24
58
},
59
{
60
x: 'West Africa',
61
low: 1,
62
q1: 6,
63
median: 8,
64
q3: 13,
65
high: 16
66
},
67
{
68
x: 'Central Africa',
69
low: 2,
70
q1: 4,
71
median: 9,
72
q3: 12,
73
high: 15
74
},
75
{
76
x: 'Southern Africa',
77
low: 1,
78
q1: 4,
79
median: 8,
80
q3: 11,
81
high: 14
82
}
83
];
84
85
// create box chart
86
var chart = anychart.box();
87
88
// set chart title text settings
89
90
chart.title('Oceanic Airlines Delays December, 2014');
91
92
// set axes settings
93
chart.xAxis().staggerMode(true);
94
95
chart.box(data);
96
97
// set container id for the chart
98
chart.container('container');
99
100
// initiate chart drawing
101
chart.draw();
102
});