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
var data = [
3
{y: "Part 1", x: "Mobile", heat: 15},
4
{y: "Part 2", x: "Mobile", heat: 17},
5
{y: "Part 3", x: "Mobile", heat: 21},
6
{y: "Part 4", x: "Mobile", heat: 23},
7
{y: "Part 5", x: "Mobile", heat: 20},
8
{y: "Part 6", x: "Mobile", heat: 33},
9
{y: "Part 7", x: "Mobile", heat: 19},
10
{y: "Part 1", x: "WebMail", heat: 34},
11
{y: "Part 2", x: "WebMail", heat: 33},
12
{y: "Part 3", x: "WebMail", heat: 32},
13
{y: "Part 4", x: "WebMail", heat: 30},
14
{y: "Part 5", x: "WebMail", heat: 20},
15
{y: "Part 6", x: "WebMail", heat: 7},
16
{y: "Part 7", x: "WebMail", heat: 21},
17
{y: "Part 1", x: "Desktop", heat: 43},
18
{y: "Part 2", x: "Desktop", heat: 42},
19
{y: "Part 3", x: "Desktop", heat: 40},
20
{y: "Part 4", x: "Desktop", heat: 38},
21
{y: "Part 5", x: "Desktop", heat: 24},
22
{y: "Part 6", x: "Desktop", heat: 36},
23
{y: "Part 7", x: "Desktop", heat: 23},
24
{y: "Part 1", x: "Undetected", heat: 6},
25
{y: "Part 2", x: "Undetected", heat: 8},
26
{y: "Part 3", x: "Undetected", heat: 7},
27
{y: "Part 4", x: "Undetected", heat: 8},
28
{y: "Part 5", x: "Undetected", heat: 15},
29
{y: "Part 6", x: "Undetected", heat: 4},
30
{y: "Part 7", x: "Undetected", heat: 9}
31
];
32
33
// create heat map chart
34
var chart = anychart.heatMap(data);
35
36
// enable scrollers
37
chart.yScroller(true);
38
chart.xScroller(true);
39
40
// define Y zoom limits
41
chart.yZoom().setToValues("Part 1", "Part 4");
42
43
chart.container("container");
44
chart.draw();
45
});