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.waterfall([
5
{x: 'Net Sales', value: 5085000},
6
{x: 'Cost of Sales', value: -1250450},
7
{x: 'Gross Income', isTotal: true},
8
{x: 'Operating Expenses', value: -2350050},
9
{x: 'Operating Income', isTotal: true},
10
{x: 'Other Income', value: 750000},
11
{x: 'Extraordinary Gain', value: -230050}
12
]);
13
chart.title('Get and use plot bounds object');
14
chart.container(stage);
15
chart.draw();
16
17
// Get plot bounds.
18
var bounds = chart.getPlotBounds();
19
20
var customBackground = anychart.standalones.background();
21
customBackground.fill('#BDBDBD 0.2');
22
customBackground.parentBounds(bounds);
23
customBackground.container(stage);
24
customBackground.draw();
25
});