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.gauges.linear([300, 250, 150]);
5
chart.addPointer(0, 1, 2);
6
chart.title('Get and use pixel bounds object');
7
chart.container(stage);
8
chart.draw();
9
10
// Get pixel bounds.
11
var bounds = chart.getPixelBounds();
12
13
var customBackground = anychart.standalones.background();
14
customBackground.fill('#ff7f50 0.2');
15
customBackground.parentBounds(bounds);
16
customBackground.container(stage);
17
customBackground.draw();
18
});