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
var data = getData();
3
4
var chart = anychart.resource();
5
chart.data(data);
6
chart.zoomLevel(1);
7
8
// Set overlay settings.
9
chart.overlay({id: "container2", enabled: true});
10
// Now you can do anything with DIV Element.
11
12
chart.container("container");
13
chart.draw();
14
});
15
function getData() {
16
return [
17
{
18
"name": "Vasil Kiryienka",
19
"description": "Rider",
20
"activities": [
21
{
22
"name": "World Championships",
23
"start": '2016-10-12',
24
"end": '2016-10-12'
25
}
26
]
27
},
28
{
29
"name": "Elia Viviani",
30
"description": "Rider",
31
"activities": [
32
{
33
"name": "Paris - Tours",
34
"start": '2016-10-09',
35
"end": '2016-10-09',
36
"fill": ["#1A237E", "#FFFFFF", "#D50000"]
37
},
38
{
39
"name": "World Championships",
40
"start": '2016-10-16',
41
"end": '2016-10-16'
42
},
43
{
44
"name": "Abu Dhabi Tour",
45
"start": '2016-10-20',
46
"end": '2016-10-23',
47
"fill": "#FFA000"
48
}
49
]
50
},
51
{
52
"name": "Ben Swift",
53
"description": "Rider",
54
"activities": [
55
{
56
"name": "World Championships",
57
"start": '2016-10-09',
58
"end": '2016-10-09'
59
},
60
{
61
"name": "World Championships",
62
"start": '2016-10-16',
63
"end": '2016-10-16'
64
}
65
]
66
},
67
{
68
"name": "Michal Kwiatkowski",
69
"description": "Rider",
70
"activities": [
71
{
72
"name": "World Championships",
73
"start": '2016-10-09',
74
"end": '2016-10-09'
75
},
76
{
77
"name": "Abu Dhabi Tour",
78
"start": '2016-10-20',
79
"end": '2016-10-23',
80
"fill": "#FFA000"
81
}
82
]
83
},
84
{
85
"name": "Alex Peters",
86
"description": "Rider",
87
"activities": [
88
{
89
"name": "Japan Cup",
90
"start": '2016-10-23',
91
"end": '2016-10-23',
92
"fill": "#EF9A9A"
93
}
94
]
95
},
96
{
97
"name": "Ian Stannard",
98
"description": "Rider",
99
"activities": [
100
{
101
"name": "Paris - Tours",
102
"start": '2016-10-09',
103
"end": '2016-10-09',
104
"fill": ["#1A237E", "#FFFFFF", "#D50000"]
105
},
106
{
107
"name": "World Championships",
108
"start": '2016-10-16',
109
"end": '2016-10-16'
110
}
111
]
112
},
113
{
114
"name": "Lars Petter Nordhaug",
115
"description": "Rider",
116
"activities": [
117
{
118
"name": "Paris - Tours",
119
"start": '2016-10-09',
120
"end": '2016-10-09',
121
"fill": ["#1A237E", "#FFFFFF", "#D50000"]
122
},
123
{
124
"name": "Japan Cup",
125
"start": '2016-10-23',
126
"end": '2016-10-23',
127
"fill": "#EF9A9A"
128
}
129
]
130
},
131
{
132
"name": "Nicolas Roche",
133
"description": "Rider",
134
"activities": [
135
{
136
"name": "World Championships",
137
"start": '2016-10-09',
138
"end": '2016-10-09'
139
},
140
{
141
"name": "World Championships",
142
"start": '2016-10-12',
143
"end": '2016-10-12'
144
},
145
{
146
"name": "Abu Dhabi Tour",
147
"start": '2016-10-20',
148
"end": '2016-10-23',
149
"fill": "#FFA000"
150
}
151
]
152
},
153
{
154
"name": "Geraint Thomas",
155
"description": "Rider",
156
"activities": [
157
{
158
"name": "World Championships",
159
"start": '2016-10-09',
160
"end": '2016-10-09'
161
},
162
{
163
"name": "World Championships",
164
"start": '2016-10-16',
165
"end": '2016-10-16'
166
}
167
]
168
},
169
{
170
"name": "Danny van Poppel",
171
"description": "Rider",
172
"activities": [
173
{
174
"name": "World Championships",
175
"start": '2016-10-09',
176
"end": '2016-10-09'
177
},
178
{
179
"name": "World Championships",
180
"start": '2016-10-16',
181
"end": '2016-10-16'
182
},
183
{
184
"name": "Abu Dhabi Tour",
185
"start": '2016-10-20',
186
"end": '2016-10-23',
187
"fill": "#FFA000"
188
}
189
]
190
},
191
{
192
"name": "David Lopez",
193
"description": "Rider",
194
"activities": [
195
{
196
"name": "Japan Cup",
197
"start": '2016-10-23',
198
"end": '2016-10-23',
199
"fill": "#EF9A9A"
200
}
201
]
202
},
203
{
204
"name": "Xabier Zandio",
205
"description": "Rider",
206
"activities": [
207
{
208
"name": "Japan Cup",
209
"start": '2016-10-23',
210
"end": '2016-10-23',
211
"fill": "#EF9A9A"
212
}
213
]
214
}
215
];
216
}