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': 5});
9
10
// create a chart
11
var chart = anychart.stock();
12
13
// add two series
14
lineSeries = chart.plot(0).line(mapping);
15
16
indicator1 = chart.plot(0).priceIndicator(0, {value: 'first-visible'});
17
indicator2 = chart.plot(0).priceIndicator(1, {value: 'series-end'});
18
indicator3 = chart.plot(0).priceIndicator(2, {value: '2006-08-09'});
19
20
// set the chart position and title
21
chart.title("Price Indicator: Source Date");
22
23
// chart padding
24
chart.padding().left(75);
25
26
// disable grouping
27
chart.grouping(false);
28
29
// set the chart container
30
chart.container("container");
31
32
// initiate drawing the chart
33
chart.draw();
34
});