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.heatMap(data);
9
10
// Set context menu setting.
11
chart.contextMenu({enabled: false});
12
13
chart.title('Set context menu parameter as an object. Context menu is disabled using object in this sample');
14
chart.container('container');
15
chart.draw();
16
});
17
18
function getData() {
19
return [
20
{x: 'California', y: '2004', heat: 1704211},
21
{x: 'California', y: '2005', heat: 2782680},
22
{x: 'California', y: '2006', heat: 2992679},
23
{x: 'Illinois', y: '2004', heat: 727914},
24
{x: 'Illinois', y: '2005', heat: 1150659},
25
{x: 'Illinois', y: '2006', heat: 1134085},
26
{x: 'Massachusetts', y: '2004', heat: 238819},
27
{x: 'Massachusetts', y: '2005', heat: 157719},
28
{x: 'Massachusetts', y: '2006', heat: 887169},
29
{x: 'New York', y: '2004', heat: 1667969},
30
{x: 'New York', y: '2005', heat: 2763503},
31
{x: 'New York', y: '2006', heat: 3151022},
32
{x: 'Texas', y: '2004', heat: 219967},
33
{x: 'Texas', y: '2005', heat: 3732889},
34
{x: 'Texas', y: '2006', heat: 4185098}
35
]
36
}