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 chart = anychart.pyramid([
5
{x: 'Physical', value: 125},
6
{x: 'Data Link', value: 125},
7
{x: 'Network', value: 125},
8
{x: 'Transport', value: 125},
9
{x: 'Session', value: 125},
10
{x: 'Presentation', value: 125},
11
{x: 'Application', value: 290}
12
]);
13
chart.title('Get and use pixel bounds object');
14
chart.container(stage);
15
chart.draw();
16
17
// Gets pixel bounds.
18
var bounds = chart.getPixelBounds();
19
20
var customBackground = anychart.standalones.background();
21
customBackground.fill('#ff7f50 0.2');
22
customBackground.parentBounds(bounds);
23
customBackground.container(stage);
24
customBackground.draw();
25
});