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 priceIndicator = plot.priceIndicator();
13
14
priceIndicator.value('series-start');
15
16
// Set value field.
17
priceIndicator.valueField('high');
18
19
chart.title('Set value field');
20
chart.container('container');
21
chart.draw();
22
23
chart.selectRange('2005-01-01', '2007-01-01');
24
});