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 customAxis = anychart.standalones.axes.linear();
5
customAxis.orientation('left');
6
7
var customScale = anychart.scales.ordinal();
8
customScale.values([1, 2, 3]);
9
10
customAxis.scale(customScale);
11
customAxis.parentBounds(50, 50, 300, 400);
12
customAxis.container(stage);
13
customAxis.draw();
14
15
// Get remaining bounds.
16
var bounds = customAxis.getRemainingBounds();
17
18
var customLabel = anychart.standalones.label();
19
customLabel.text('Get and use remaining bounds');
20
customLabel.parentBounds(bounds);
21
customLabel.width('100%');
22
customLabel.height('100%');
23
customLabel.padding(15);
24
customLabel.background({fill: '#80CBC4 0.2'});
25
customLabel.enabled(true);
26
customLabel.container(stage);
27
customLabel.draw();
28
});