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
// change action of an item
16
chart.contextMenu().itemsFormatter(function(items){
17
18
// modify print item action
19
items["print-chart"].action = function() {
20
alert('Custom action');
21
};
22
23
return items;
24
});
25
26
// set title
27
chart.title("Context Menu: Items Text Changed");
28
29
// draw
30
chart.container("container");
31
chart.draw();
32
});