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', '100%', '100%');
3
4
var scale = anychart.scales.log();
5
scale.minimum(5);
6
scale.maximum(100);
7
8
var chart1 = anychart.sparkline([5, 50, 10, 60, 15, 40]);
9
10
// Set Y scale.
11
chart1.yScale(scale);
12
13
chart1.bounds('0%', 0, '50%', '5%');
14
chart1.height('10%');
15
chart1.container(stage);
16
chart1.draw();
17
18
var chart2 = anychart.sparkline([30, 5, 30, 10, 35, 15]);
19
20
// Set Y scale.
21
chart2.yScale(scale);
22
23
chart2.bounds('50%', 0, '50%', '5%');
24
chart2.height('10%');
25
chart2.container(stage);
26
chart2.draw();
27
28
var customTitle = anychart.standalones.title();
29
customTitle.text('Set YScale');
30
customTitle.orientation('top');
31
customTitle.container(stage);
32
customTitle.draw();
33
});