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
var controller = chart.annotations();
7
8
var annotation = controller.fibonacciRetracement();
9
10
annotation.xAnchor(1);
11
annotation.valueAnchor(10);
12
annotation.secondXAnchor(2);
13
annotation.secondValueAnchor(18);
14
15
// Set hover trend.
16
annotation.hoverTrend(function () {
17
return "3 " + this.sourceColor;
18
});
19
20
chart.title("Set hover trend parameter as a function.");
21
chart.container("container");
22
chart.draw();
23
});