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 firstChart = anychart.sparkline([5, 50, 10, 60, 15, 40]);
9
10
// Set YScale.
11
firstChart.yScale(scale);
12
13
firstChart.bounds("0%", 0, "50%", "5%");
14
firstChart.height("10%");
15
firstChart.container(stage);
16
firstChart.draw();
17
18
var secondChart = anychart.sparkline([30, 5, 30, 10, 35, 15]);
19
20
// Set YScale.
21
secondChart.yScale(scale);
22
23
secondChart.bounds("50%", 0, "50%", "5%");
24
secondChart.height("10%");
25
secondChart.container(stage);
26
secondChart.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
});