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
// To change the way how context menu looks you need to change CSS.
3
// By default CSS from AnyChart CDN is used: https://cdn.anychart.com/releases/8.13.0/css/anychart-ui.min.css
4
// Download it, alter, upload to your server and link from your pages to change the look.
5
6
var data = getData();
7
8
var chart = anychart.resource();
9
chart.data(data).zoomLevel(1);
10
11
// Set context menu setting.
12
chart.contextMenu({enabled: false});
13
14
chart.title('Set context menu parameter as an object. Context menu is disabled using object in this sample');
15
chart.container('container');
16
chart.draw();
17
});
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
fill: ['#1A237E', '#FFFFFF', '#D50000']
41
},
42
{
43
name: 'World Championships',
44
start: '2016-10-16',
45
end: '2016-10-16'
46
},
47
{
48
name: 'Abu Dhabi Tour',
49
start: '2016-10-20',
50
end: '2016-10-23',
51
fill: '#FFA000'
52
}
53
]
54
},
55
{
56
name: 'Ben Swift',
57
description: 'Rider',
58
activities: [
59
{
60
name: 'World Championships',
61
start: '2016-10-09',
62
end: '2016-10-09'
63
},
64
{
65
name: 'World Championships',
66
start: '2016-10-16',
67
end: '2016-10-16'
68
}
69
]
70
},
71
{
72
name: 'Michal Kwiatkowski',
73
description: 'Rider',
74
activities: [
75
{
76
name: 'World Championships',
77
start: '2016-10-09',
78
end: '2016-10-09'
79
},
80
{
81
name: 'Abu Dhabi Tour',
82
start: '2016-10-20',
83
end: '2016-10-23',
84
fill: '#FFA000'
85
}
86
]
87
},
88
{
89
name: 'Alex Peters',
90
description: 'Rider',
91
activities: [
92
{
93
name: 'Japan Cup',
94
start: '2016-10-23',
95
end: '2016-10-23',
96
fill: '#EF9A9A'
97
}
98
]
99
},
100
{
101
name: 'Ian Stannard',
102
description: 'Rider',
103
activities: [
104
{
105
name: 'Paris - Tours',
106
start: '2016-10-09',
107
end: '2016-10-09',
108
fill: ['#1A237E', '#FFFFFF', '#D50000']
109
},
110
{
111
name: 'World Championships',
112
start: '2016-10-16',
113
end: '2016-10-16'
114
}
115
]
116
},
117
{
118
name: 'Lars Petter Nordhaug',
119
description: 'Rider',
120
activities: [
121
{
122
name: 'Paris - Tours',
123
start: '2016-10-09',
124
end: '2016-10-09',
125
fill: ['#1A237E', '#FFFFFF', '#D50000']
126
},
127
{
128
name: 'Japan Cup',
129
start: '2016-10-23',
130
end: '2016-10-23',
131
fill: '#EF9A9A'
132
}
133
]
134
},
135
{
136
name: 'Nicolas Roche',
137
description: 'Rider',
138
activities: [
139
{
140
name: 'World Championships',
141
start: '2016-10-09',
142
end: '2016-10-09'
143
},
144
{
145
name: 'World Championships',
146
start: '2016-10-12',
147
end: '2016-10-12'
148
},
149
{
150
name: 'Abu Dhabi Tour',
151
start: '2016-10-20',
152
end: '2016-10-23',
153
fill: '#FFA000'
154
}
155
]
156
},
157
{
158
name: 'Geraint Thomas',
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-16',
169
end: '2016-10-16'
170
}
171
]
172
},
173
{
174
name: 'Danny van Poppel',
175
description: 'Rider',
176
activities: [
177
{
178
name: 'World Championships',
179
start: '2016-10-09',
180
end: '2016-10-09'
181
},
182
{
183
name: 'World Championships',
184
start: '2016-10-16',
185
end: '2016-10-16'
186
},
187
{
188
name: 'Abu Dhabi Tour',
189
start: '2016-10-20',
190
end: '2016-10-23',
191
fill: '#FFA000'
192
}
193
]
194
},
195
{
196
name: 'David Lopez',
197
description: 'Rider',
198
activities: [
199
{
200
name: 'Japan Cup',
201
start: '2016-10-23',
202
end: '2016-10-23',
203
fill: '#EF9A9A'
204
}
205
]
206
},
207
{
208
name: 'Xabier Zandio',
209
description: 'Rider',
210
activities: [
211
{
212
name: 'Japan Cup',
213
start: '2016-10-23',
214
end: '2016-10-23',
215
fill: '#EF9A9A'
216
}
217
]
218
}
219
];
220
}