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.sparkline([1.3, 2, 1.4, 4, 2.3, 6]);
3
chart.title({text: 'Click on the chart and then double-click', orientation: 'top'});
4
5
chart.listen('click', function (e) {
6
chart.title({fontColor: '#4CAF50'});
7
});
8
9
chart.listen('dblClick', function (e) {
10
chart.title('You can\'t click here anymore');
11
chart.title({fontColor: '#000000'});
12
13
// Removes all listeners.
14
chart.removeAllListeners();
15
16
});
17
18
chart.container('container');
19
chart.draw();
20
});