diff --git a/rd_ui/app/scripts/ng_highchart.js b/rd_ui/app/scripts/ng_highchart.js index bdcd742d..a9e39cba 100644 --- a/rd_ui/app/scripts/ng_highchart.js +++ b/rd_ui/app/scripts/ng_highchart.js @@ -81,6 +81,45 @@ series.update({stacking: newStacking}, true); }); } + }, + { + text: 'Select All', + onclick: function () { + _.each(this.series, function (s) { + s.setVisible(true, false); + }); + this.redraw(); + } + }, + { + text: 'Unselect All', + onclick: function () { + _.each(this.series, function (s) { + s.setVisible(false, false); + }); + this.redraw(); + } + }, + { + text: 'Show Total', + onclick: function () { + var data = {}; + _.each(this.series, function (s) { + s.setVisible(false, false); + _.each(s.data, function (p) { + data[p.x] = data[p.x] || {'x': p.x, 'y': 0}; + data[p.x].y = data[p.x].y + p.y; + }); + }); + + this.addSeries({ + data: _.values(data), + type: 'line', + name: 'Total' + }, false) + + this.redraw(); + } } ] }