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
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
dataTable.addData(get_dji_daily_short_data());
7
8
var mapping = dataTable.mapAs({open: 1, high: 2, low: 3, close: 4, 'volume': 5});
9
10
var chart = anychart.stock();
11
12
var plot = chart.plot();
13
plot.ohlc(mapping);
14
15
var indicatorPlot = chart.plot(1);
16
17
var atrIndicator = indicatorPlot.adl(mapping, 'column');
18
19
var series = atrIndicator.series();
20
21
// Enable access to the point settings.
22
series.allowPointSettings(true);
23
24
series.fill(function () {
25
if (this.iterator.getIndex() > 150)
26
return '#81C784';
27
else
28
return this.sourceColor;
29
});
30
31
indicatorPlot.yAxis().labels().format(function () {
32
return anychart.format.number(this.value, {scale: true})
33
});
34
35
chart.title('Enable access to the point settings and modify the point');
36
chart.container('container');
37
chart.draw();
38
});