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 = anychart.data.set([
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
]);
18
19
var chart = anychart.heatMap(data);
20
21
// Get data.
22
var getData = chart.data();
23
24
var newData = getData.concat([
25
{x: "Texas", y: "2006", heat: 4185098}
26
]);
27
28
chart.title("Get and modify chart data.");
29
chart.data(newData);
30
chart.labels(true);
31
chart.container("container");
32
chart.draw();
33
});