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.selectStroke("3 #fff");
23
heatMapChart.bounds(0, 0, "50%", "100%");
24
heatMapChart.container(stage);
25
heatMapChart.draw();
26
27
var pieChart = anychart.pie([7, 10, 7, 10, 11]);
28
pieChart.bounds("50%", 0, "50%", "100%");
29
30
// Get chart stroke in selected mode.
31
var heatMapChartSelectStroke = heatMapChart.selectStroke();
32
33
pieChart.stroke(heatMapChartSelectStroke);
34
pieChart.container(stage);
35
pieChart.draw();
36
37
var customTitle = anychart.standalones.title();
38
customTitle.text("Get and use chart selectStroke.");
39
customTitle.container(stage);
40
customTitle.draw();
41
});