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 data = [
3
[1980, 20],
4
[1981, 22],
5
[1982, 21],
6
[1983, 25],
7
[1984, 19],
8
[1985, 28],
9
[1986, 27],
10
[1987, 18],
11
[1988, 23],
12
[1989, 15],
13
[1990, 10],
14
[1991, 12]
15
];
16
17
var chart = anychart.line(data);
18
19
chart.getSeries(0).name("Youth unemployment ratio in Nevada");
20
21
// create the title
22
chart.title("Single-hover feature");
23
24
// multi-hover enabling
25
chart.interactivity("by-x");
26
27
chart.crosshair(true);
28
chart.container("container");
29
chart.draw();
30
});