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