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.line([
4
{x: 0, value: 20},
5
{x: 1, value: 50},
6
{x: 2, value: 30},
7
{x: 3, value: 90},
8
{x: 4, value: 40}
9
]);
10
11
var crosshair = chart.crosshair();
12
crosshair.enabled(true);
13
14
var crosshairXLabel = crosshair.xLabel();
15
16
// Set offset X.
17
crosshairXLabel.offsetX(12);
18
19
chart.title('Set offset X');
20
chart.container('container');
21
chart.draw();
22
});