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.scatter();
3
chart.xScale().minimum(-1);
4
5
var firstSeries = chart.line([
6
{x: 0, value: 22},
7
{x: 1, value: 34},
8
{x: 2, value: 16},
9
{x: 3, value: 12},
10
{x: 4, value: 41},
11
{x: 5, value: 47}
12
]);
13
14
var secondSeries = chart.line([
15
{x: 0, value: 39},
16
{x: 1, value: 28},
17
{x: 2, value: 21},
18
{x: 3, value: 18},
19
{x: 4, value: 24},
20
{x: 5, value: 29}
21
]);
22
23
// Get chart hover labels.
24
var hoverLabels = chart.hoverLabels();
25
hoverLabels.enabled(true);
26
27
chart.title("Get and modify chart hover labels");
28
chart.container("container");
29
chart.draw();
30
31
firstSeries.hover([0, 2, 4]);
32
secondSeries.hover([1, 3, 5]);
33
});