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.line([1, 4, 2, 6]);
5
6
var myTitle = chart.title();
7
myTitle.enabled(true);
8
myTitle.text("MouseOver the title and click on line series.");
9
10
lineSeries.listen("pointMouseOut", function (e) {
11
myTitle.fontColor("#4CAF50");
12
});
13
lineSeries.listen("pointMouseOver", function (e) {
14
myTitle.fontColor("#F44336");
15
});
16
lineSeries.listen("pointClick", function (e) {
17
myTitle.text("You can\'t click here anymore.");
18
myTitle.fontColor("#000000");
19
// Removes all listeners.
20
lineSeries.removeAllListeners();
21
});
22
23
chart.container("container");
24
chart.draw();
25
});