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 table = anychart.data.table();
3
4
// The data used in this sample can be obtained from the CDN
5
// https://cdn.anychart.com/csv-data/dji-daily-short.js
6
table.addData(get_dji_daily_short_data());
7
8
var mapping = table.mapAs({open: 1, high: 2, low: 3, close: 4, value: 4});
9
10
var chart = anychart.stock();
11
12
var plot = chart.plot();
13
plot.ohlc(mapping);
14
plot.bbands(mapping);
15
16
var indicatorPlot = chart.plot(1);
17
18
var bbandsBIndicator = indicatorPlot.bbandsB(mapping);
19
20
// Get series.
21
var indicatorSeries = bbandsBIndicator.series();
22
indicatorSeries.stroke('3 #8BC34A');
23
24
chart.title('Get and modify series');
25
chart.container('container');
26
chart.draw();
27
});