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 stage = anychart.graphics.create("container");
3
4
var heatMapChart = anychart.heatMap([
5
{x: "California", y: "2004", heat: 1704211},
6
{x: "California", y: "2005", heat: 2782680},
7
{x: "California", y: "2006", heat: 2992679},
8
{x: "Illinois", y: "2004", heat: 727914},
9
{x: "Illinois", y: "2005", heat: 1150659},
10
{x: "Illinois", y: "2006", heat: 1134085},
11
{x: "Massachusetts", y: "2004", heat: 238819},
12
{x: "Massachusetts", y: "2005", heat: 157719},
13
{x: "Massachusetts", y: "2006", heat: 887169},
14
{x: "New York", y: "2004", heat: 1667969},
15
{x: "New York", y: "2005", heat: 2763503},
16
{x: "New York", y: "2006", heat: 3151022},
17
{x: "Texas", y: "2004", heat: 219967},
18
{x: "Texas", y: "2005", heat: 3732889},
19
{x: "Texas", y: "2006", heat: 4185098}
20
]);
21
heatMapChart.labels(true);
22
heatMapChart.selectFill("#FFECB3");
23
heatMapChart.stroke('#fff');
24
heatMapChart.bounds(0, 0, "50%", "100%");
25
heatMapChart.container(stage);
26
heatMapChart.draw();
27
28
var pieChart = anychart.pie([7, 10, 7, 10, 11]);
29
pieChart.bounds("50%", 0, "50%", "100%");
30
31
// Get chart fill in selected state.
32
var heatMapChartSelectFill = heatMapChart.selectFill();
33
34
pieChart.stroke("3 " + heatMapChartSelectFill);
35
pieChart.container(stage);
36
pieChart.draw();
37
38
var customTitle = anychart.standalones.title();
39
customTitle.text("Get and use chart selectFill.");
40
customTitle.container(stage);
41
customTitle.draw();
42
});