HTMLcopy
1
<button onclick="removeTotal()">Remove total</button>
2
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 95%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var chart, total;
2
anychart.onDocumentReady(function () {
3
var rawData = [
4
["Jan", 22],
5
["Feb", 14],
6
["Mar", -6],
7
["Apr", 37],
8
["May", -40],
9
["Jun", 55],
10
["Jul", 22],
11
["Aug", 23],
12
["Sep", 42],
13
["Oct", 67],
14
["Nov", 61],
15
["Dec", 51],
16
];
17
18
var data = anychart.data.set(rawData);
19
var seriesData = data.mapAs({x: 0, value: 1});
20
21
chart = anychart.waterfall();
22
23
chart.addSeries(seriesData);
24
25
chart.title('Remove total by instance.');
26
chart.container('container');
27
28
total = chart.addTotal({x: 'May', name: 'Subtotal'});
29
30
chart.draw();
31
});
32
33
function removeTotal() {
34
chart.removeTotal(total);
35
}