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
chart = anychart.line();
5
chart.line([10, 4, 17, 20, 16, 35, 6, 15]);
6
chart.title("Get and use plot bounds object.");
7
chart.container(stage);
8
chart.draw();
9
10
// Gets plot bounds.
11
var bounds = chart.getPlotBounds();
12
13
var customBackground = anychart.standalones.background();
14
customBackground.fill("#BDBDBD 0.2");
15
customBackground.parentBounds(bounds);
16
customBackground.container(stage);
17
customBackground.draw();
18
});