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 chart = anychart.line([
3
{x: 0, value: 6},
4
{x: 1, value: 10},
5
{x: 2, value: 18},
6
{x: 3, value: 11},
7
{x: 4, value: 9}
8
]);
9
chart.yScale({minimum: 0});
10
chart.xScale('linear');
11
12
// Set annotations settings.
13
chart.annotations([{
14
type: 'ellipse',
15
xAnchor: 1.9,
16
valueAnchor: 17,
17
secondXAnchor: 2.1,
18
secondValueAnchor: 19,
19
fill: '#4CAF50 0.5',
20
stroke: '3 #FF9800'
21
}, {
22
type: 'triangle',
23
xAnchor: 2.9,
24
valueAnchor: 10.5,
25
secondXAnchor: 3.1,
26
secondValueAnchor: 10.5,
27
thirdXAnchor: 3,
28
thirdValueAnchor: 12,
29
fill: '#80deea 0.5',
30
stroke: '3 #FFD54F'
31
}]);
32
33
chart.title('Set annotations settings');
34
chart.container('container');
35
chart.draw();
36
});