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
3
// create a chart
4
var chart = anychart.column();
5
6
// set chart data
7
chart.data([
8
["John" , 10000, 12000],
9
["Jake" , 12000, 15000],
10
["Peter", 18000, 16000],
11
["James", 11000, 13000],
12
["Mary", 9000, 19000]
13
]);
14
15
// remove two element from the menu
16
chart.contextMenu().itemsFormatter(function(items){
17
// Disable save as image option
18
delete items["save-chart-as"];
19
20
// delete about and separator
21
delete items["full-screen-separator"];
22
delete items["about"];
23
24
// return modified array
25
return items;
26
});
27
28
// set title
29
chart.title("Context Menu: Remove Items");
30
31
// draw
32
chart.container("container");
33
chart.draw();
34
});