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.column();
3
4
chart.data({
5
header: ['#', 'Florida', 'Texas', 'Arkansas'],
6
rows: [
7
['Apples', 5, 8, 4],
8
['Pears', 6, 2, 5],
9
['Bananas', 2, 6, 4],
10
['Peaches', 6, 3, 8]
11
]
12
});
13
chart.interactivity().hoverMode('by-x');
14
15
var title = chart.title();
16
title.enabled(true);
17
title.text('PointsHover event');
18
19
chart.listen('pointsHover', function(e) {
20
title.text('The mouse hovers over the points with name ' + e.point.get('x'))
21
});
22
23
chart.container('container');
24
chart.draw();
25
});