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