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 dataTable = anychart.data.table();
3
dataTable.addData(get_dji_daily_short_data());
4
5
var data1 = dataTable.mapAs({value: 1});
6
var data2 = dataTable.mapAs({value: 5});
7
8
var chart = anychart.stock();
9
10
var plot = chart.plot();
11
plot.line(data1);
12
plot.line(data2);
13
14
var yScale = plot.yScale();
15
yScale.comparisonMode('percent');
16
17
// Set date for the changes zero of the series.
18
yScale.compareWith('series-start');
19
20
chart.title('Set date for the changes zero of the series');
21
chart.container('container');
22
chart.draw();
23
});