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
3
// create a data table
4
var dataTable = anychart.data.table();
5
dataTable.addData(get_csco_daily_short_data());
6
7
// map the data
8
mapping = dataTable.mapAs({value: 1});
9
10
// create a stock chart
11
var chart = anychart.stock();
12
13
// create a plot and a line series
14
series = chart.plot(0).line(mapping);
15
16
// add price indicator
17
var indicator = chart.plot(0).priceIndicator({value: 'last-visible'});
18
19
// set the chart position and title
20
chart.title("Price Indicator: Basic Sample");
21
22
// set the chart container
23
chart.container("container");
24
25
// initiate drawing the chart
26
chart.draw();
27
});