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 chart = anychart.gauges.linear();
3
4
// Get scale bar.
5
var customScaleBar = chart.scaleBar();
6
customScaleBar.from(0);
7
customScaleBar.to(0.8);
8
customScaleBar.points([
9
{height: 0.50, left: 0, right: 1}
10
]);
11
12
chart.title('Get and modify scale bar');
13
chart.axis(0, {offset: '-10%'});
14
chart.container('container');
15
chart.draw();
16
});