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.andrewsPitchfork();
9
annotation.xAnchor(1);
10
annotation.valueAnchor(9);
11
annotation.secondXAnchor(1.3);
12
annotation.secondValueAnchor(15);
13
annotation.thirdXAnchor(2.2);
14
annotation.thirdValueAnchor(15);
15
16
// Set select stroke.
17
annotation.selectStroke(function () {
18
return "3 " + this.sourceColor;
19
});
20
21
chart.title("Set select stroke parameter as a function.");
22
chart.container("container");
23
chart.draw();
24
});