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