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 mapping = dataTable.mapAs({open: 1, high: 2, low: 3, close: 4});
6
7
var chart = anychart.stock();
8
9
var plot = chart.plot();
10
plot.ohlc(mapping);
11
12
var priceIndicator1 = plot.priceIndicator();
13
priceIndicator1.value('last-visible');
14
15
// Set falling stroke.
16
priceIndicator1.fallingStroke('#F44336', 2);
17
18
var priceIndicator2 = plot.priceIndicator(1);
19
priceIndicator2.value('first-visible');
20
21
// Set rising stroke.
22
priceIndicator2.risingStroke('#F44336', 2);
23
24
chart.title('Set rising and falling stroke parameters');
25
chart.container('container');
26
chart.draw();
27
28
chart.selectRange('ytd');
29
});