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
25
var conflicts = chart.conflicts();
26
27
// Set stroke.
28
conflicts.stroke('#212121', 1, '5 2');
29
30
chart.title('Set stroke parameters');
31
chart.container('container');
32
chart.draw();
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
minutesPerDay: 200
56
},
57
{
58
name: 'World Championships',
59
start: '2016-10-09',
60
end: '2016-10-09',
61
minutesPerDay: 300
62
},
63
{
64
name: 'World Championships',
65
start: '2016-10-16',
66
end: '2016-10-16'
67
},
68
{
69
name: 'Abu Dhabi Tour',
70
start: '2016-10-20',
71
end: '2016-10-23'
72
}
73
]
74
},
75
{
76
name: 'Ben Swift',
77
description: 'Rider',
78
activities: [
79
{
80
name: 'World Championships',
81
start: '2016-10-09',
82
end: '2016-10-09'
83
},
84
{
85
name: 'World Championships',
86
start: '2016-10-16',
87
end: '2016-10-16'
88
}
89
]
90
},
91
{
92
name: 'Michal Kwiatkowski',
93
description: 'Rider',
94
activities: [
95
{
96
name: 'World Championships',
97
start: '2016-10-09',
98
end: '2016-10-09'
99
},
100
{
101
name: 'Abu Dhabi Tour',
102
start: '2016-10-20',
103
end: '2016-10-23'
104
}
105
]
106
},
107
{
108
name: 'Alex Peters',
109
description: 'Rider',
110
activities: [
111
{
112
name: 'Japan Cup',
113
start: '2016-10-23',
114
end: '2016-10-23'
115
}
116
]
117
},
118
{
119
name: 'Ian Stannard',
120
description: 'Rider',
121
activities: [
122
{
123
name: 'Paris - Tours',
124
start: '2016-10-09',
125
end: '2016-10-09'
126
},
127
{
128
name: 'World Championships',
129
start: '2016-10-16',
130
end: '2016-10-16'
131
}
132
]
133
},
134
{
135
name: 'Lars Petter Nordhaug',
136
description: 'Rider',
137
activities: [
138
{
139
name: 'Paris - Tours',
140
start: '2016-10-09',
141
end: '2016-10-09'
142
},
143
{
144
name: 'Japan Cup',
145
start: '2016-10-23',
146
end: '2016-10-23'
147
}
148
]
149
},
150
{
151
name: 'Nicolas Roche',
152
description: 'Rider',
153
activities: [
154
{
155
name: 'World Championships',
156
start: '2016-10-09',
157
end: '2016-10-09'
158
},
159
{
160
name: 'World Championships',
161
start: '2016-10-12',
162
end: '2016-10-12'
163
},
164
{
165
name: 'Abu Dhabi Tour',
166
start: '2016-10-20',
167
end: '2016-10-23'
168
}
169
]
170
},
171
{
172
name: 'Geraint Thomas',
173
description: 'Rider',
174
activities: [
175
{
176
name: 'World Championships',
177
start: '2016-10-09',
178
end: '2016-10-09'
179
},
180
{
181
name: 'World Championships',
182
start: '2016-10-16',
183
end: '2016-10-16'
184
}
185
]
186
},
187
{
188
name: 'Danny van Poppel',
189
description: 'Rider',
190
activities: [
191
{
192
name: 'World Championships',
193
start: '2016-10-09',
194
end: '2016-10-09'
195
},
196
{
197
name: 'World Championships',
198
start: '2016-10-16',
199
end: '2016-10-16'
200
},
201
{
202
name: 'Abu Dhabi Tour',
203
start: '2016-10-20',
204
end: '2016-10-23'
205
}
206
]
207
},
208
{
209
name: 'David Lopez',
210
description: 'Rider',
211
activities: [
212
{
213
name: 'Japan Cup',
214
start: '2016-10-23',
215
end: '2016-10-23'
216
}
217
]
218
},
219
{
220
name: 'Xabier Zandio',
221
description: 'Rider',
222
activities: [
223
{
224
name: 'Japan Cup',
225
start: '2016-10-23',
226
end: '2016-10-23'
227
}
228
]
229
}
230
];
231
}