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.circular([{value: 7.5}]);
5
chart.axis();
6
chart.needle();
7
chart.title('Get and use pixel bounds object');
8
chart.container(stage);
9
chart.draw();
10
11
// Get pixel bounds.
12
var bounds = chart.getPixelBounds();
13
14
var customBackground = anychart.standalones.background();
15
customBackground.fill('#BDBDBD 0.2');
16
customBackground.parentBounds(bounds);
17
customBackground.container(stage);
18
customBackground.draw();
19
});