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