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
var controller = chart.annotations();
13
14
var annotation = controller.fibonacciFan();
15
annotation.xAnchor(1);
16
annotation.valueAnchor(10);
17
annotation.secondXAnchor(2);
18
annotation.secondValueAnchor(17);
19
20
var normal = annotation.normal();
21
normal.trend('#F44336', 3, '5 2', 'round');
22
23
var hovered = annotation.hovered();
24
hovered.trend('#4CAF50');
25
26
var selected = annotation.selected();
27
selected.trend('#03A9F4', 5);
28
29
chart.title('Set normal, hovered and selected states settings for annotations');
30
chart.container('container');
31
chart.draw();
32
});