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
4
var series = chart.line([
5
{x: 0, value: 20},
6
{x: 1, value: 50},
7
{x: 2, value: 30},
8
{x: 3, value: 90},
9
{x: 4, value: 40}
10
]);
11
series.markers(true);
12
13
var crosshair = chart.crosshair();
14
crosshair.enabled(true);
15
16
// Set display mode.
17
crosshair.displayMode('sticky');
18
19
chart.interactivity({hoverMode: 'by-x'});
20
21
chart.title('Set display mode');
22
chart.container('container');
23
chart.draw();
24
});