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