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 chart = anychart.heatMap([
3
{x: "California", y: "2004", heat: 1704211},
4
{x: "California", y: "2005", heat: 2782680},
5
{x: "California", y: "2006", heat: 2992679},
6
{x: "Illinois", y: "2004", heat: 727914},
7
{x: "Illinois", y: "2005", heat: 1150659},
8
{x: "Illinois", y: "2006", heat: 1134085},
9
{x: "Massachusetts", y: "2004", heat: 238819},
10
{x: "Massachusetts", y: "2005", heat: 157719},
11
{x: "Massachusetts", y: "2006", heat: 887169},
12
{x: "New York", y: "2004", heat: 1667969},
13
{x: "New York", y: "2005", heat: 2763503},
14
{x: "New York", y: "2006", heat: 3151022},
15
{x: "Texas", y: "2004", heat: 219967},
16
{x: "Texas", y: "2005", heat: 3732889},
17
{x: "Texas", y: "2006", heat: 4185098}
18
]);
19
20
chart.labels(true);
21
22
// Set Y-axis settings by index.
23
chart.yAxis(0, {title: "Y-Axis"});
24
chart.yAxis(1, {orientation: "right", title: true});
25
26
chart.title("Set chart yAxis by index as an object.");
27
chart.container("container");
28
chart.draw();
29
});