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: "2010", y: "A", heat: 15},
6
{x: "2011", y: "A", heat: 17},
7
{x: "2012", y: "A", heat: 21},
8
{x: "2010", y: "B", heat: 34},
9
{x: "2011", y: "B", heat: 33},
10
{x: "2012", y: "B", heat: 32},
11
{x: "2010", y: "C", heat: 51},
12
{x: "2011", y: "C", heat: 50},
13
{x: "2012", y: "C", heat: 47}
14
];
15
16
// create a chart and set the data
17
var chart = anychart.heatMap(data);
18
19
// set the chart title
20
chart.title("Heat Map: Basic Sample");
21
22
// set the container id
23
chart.container("container");
24
25
// initiate drawing the chart
26
chart.draw();
27
});