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