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