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