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