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 data
4
var data = [
5
{x: "1", y: "A", fill: "#ffcc00"},
6
{x: "1", y: "B", fill: "#ffcc00"},
7
{x: "1", y: "C", fill: "#ff9933"},
8
{x: "1", y: "D", fill: "#ff9933"},
9
{x: "2", y: "A", fill: "#ffcc00"},
10
{x: "2", y: "B", fill: "#ff9933"},
11
{x: "2", y: "C", fill: "#ff9933"},
12
{x: "2", y: "D", fill: "#ff9933"},
13
{x: "3", y: "A", fill: "#ff9933"},
14
{x: "3", y: "B", fill: "#ff9933"},
15
{x: "3", y: "C", fill: "#ff6600"},
16
{x: "3", y: "D", fill: "#ff6600"},
17
{x: "4", y: "A", fill: "#ff9933"},
18
{x: "4", y: "B", fill: "#ff9933"},
19
{x: "4", y: "C", fill: "#ff6600"},
20
{x: "4", y: "D",
21
normal: {
22
fill: "#ff0000",
23
stroke: "4 #b30059"
24
},
25
hovered: {
26
fill: "#ff0000",
27
stroke: "5 white"
28
},
29
selected: {
30
fill: "#b30059",
31
stroke: "5 white"
32
}
33
}
34
];
35
36
// create a chart and set the data
37
var chart = anychart.heatMap(data);
38
39
// disable tooltips
40
chart.tooltip(false);
41
42
// set the chart title
43
chart.title("Heat Map: Appearance (Individual Points)");
44
45
// set the container id
46
chart.container("container");
47
48
// initiate drawing the chart
49
chart.draw();
50
});