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 format.
17
crosshairXLabel.format(function () {
18
return "Value is " + this.value;
19
});
20
21
chart.title("Set label format");
22
chart.container("container");
23
chart.draw();
24
});