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
{x: 'Meat', value: 10},
4
{x: 'Fruit', value: -12},
5
{x: 'Nuts', value: 18},
6
{x: 'Milk', value: 11},
7
{x: 'Fish', value: 9}
8
]);
9
chart.title('Click on the chart and then double-click');
10
11
chart.listen('click', function (e) {
12
chart.title({fontColor: '#4CAF50'});
13
});
14
15
chart.listen('dblClick', function (e) {
16
chart.title('You can\'t click here anymore');
17
chart.title({fontColor: '#000000'});
18
19
// Removes all listeners.
20
chart.removeAllListeners();
21
22
});
23
chart.container('container');
24
chart.draw();
25
});