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