anychart.onDocumentReady(function () {
var stage = anychart.graphics.create("container");
var chart = anychart.line([1, 2, 1.3, 2.9]);
chart.contextMenu(false);
chart.bounds(0, "10%", "100%", "90%");
var customContextMenu = anychart.ui.contextMenu();
customContextMenu.attach(chart);
customContextMenu.items([
text: "Open AnyChart API",
href: "https://api.anychart.com"
var showLabel = anychart.standalones.label();
showLabel.background({fill: "#9E9E9E"});
showLabel.text("Show context menu.");
showLabel.fontColor("#fff");
showLabel.parentBounds(0, 0, 100, 100);
showLabel.listen("click", function () {
customContextMenu.show(150, 150);
showLabel.container(stage);
var hideLabel = anychart.standalones.label();
hideLabel.background({fill: "#9E9E9E"});
hideLabel.text("Hide context menu.");
hideLabel.fontColor("#fff");
hideLabel.parentBounds(0, 30, 100, 100);
hideLabel.listen("click", function () {
customContextMenu.hide();
hideLabel.container(stage);
chart.title("Show and hide context menu.");