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 texts for two items
16
chart.contextMenu().itemsFormatter(function(items){
17
18
// change text of "Save chart as..."
19
items["save-chart-as"].text = "Export as image...";
20
21
// change text of "Save chart as..."
22
items["save-data-as"].text = "Export chart data as...";
23
24
return items;
25
});
26
27
// set title
28
chart.title("Context Menu: Items Text Changed");
29
30
// draw
31
chart.container("container");
32
chart.draw();
33
});