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({value: 1});
6
7
var chart = anychart.stock();
8
9
var plot = chart.plot();
10
plot.line(mapping);
11
12
chart.title('Get annotation plot and enable grid');
13
chart.container('container');
14
chart.draw();
15
16
var triangleAnnotations = plot.annotations();
17
triangleAnnotations.startDrawing('triangle');
18
19
var annotation = plot.annotations().getAnnotationAt(0);
20
21
// Get annotation plot.
22
var annotationPlot = annotation.getPlot();
23
24
annotationPlot.yGrid(true);
25
});