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.line();
3
4
var lineSeries = chart.column([
5
{x: 'January', value: 2},
6
{x: 'February', value: 5},
7
{x: 'March', value: 3},
8
{x: 'April', value: 9},
9
{x: 'May', value: 4}
10
]);
11
12
var title = chart.title();
13
title.enabled(true);
14
title.text('MouseOver the title and click on line series');
15
16
lineSeries.listen('pointMouseOut', function (e) {
17
title.fontColor('#4CAF50');
18
});
19
lineSeries.listen('pointMouseOver', function (e) {
20
title.fontColor('#F44336');
21
});
22
lineSeries.listen('pointClick', function (e) {
23
title.text('You can\'t click here anymore');
24
title.fontColor('#000000');
25
26
// Removes all listeners.
27
lineSeries.removeAllListeners();
28
});
29
30
chart.container('container');
31
chart.draw();
32
});