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([15, 20, 25, 30, 44]);
3
4
var scaleBar = chart.scaleBar();
5
scaleBar.from(0);
6
scaleBar.to(1);
7
scaleBar.fill('#4CAF50');
8
9
// Get scale bar fill.
10
var titleColor = scaleBar.fill();
11
12
chart.title({fontColor: titleColor, text: 'Get and use scale bar fill'});
13
chart.axis({offset: '-11%'});
14
chart.scale({minimum:0});
15
chart.container('container');
16
chart.draw();
17
});