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