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 yLabel = crosshair.yLabel();
15
16
yLabel.format(function () {
17
return '<i> Value is ' + this.value + '</i>';
18
});
19
20
// Allows to use HTML.
21
yLabel.useHtml(true);
22
23
chart.title('Allow to use HTML');
24
chart.left(50);
25
chart.container('container');
26
chart.draw();
27
});