I have added the attribute hidden-series: it takes an array as input containing the indexes of the series to hide. It defaults to the empty array [], but it can be edited in an external controller in order to hide some series programmaticaly.
For example, you can hide or show all of the series by simply setting all of the indexes in the array:
'use strict';
angular.module('chartsExample.controllers',[]).controller('MainCtrl', ['$scope','$http',
function($scope,$http) {
$http.get("charts/lineChart.json").success(function(data) {
$scope.lineChart = data;
// Shows all of the series
$scope.mHidden = [];
});
// Hides all of the series
$scope.hideAll = function() {
for (var x in $scope.mSeries) {
$scope.mHidden.push(x);
}
};
}]);
Of course, when you deselect a series from within the Highcharts chart, the array is automatically updated as well.
I have added the attribute
hidden-series
: it takes an array as input containing the indexes of the series to hide. It defaults to the empty array[]
, but it can be edited in an external controller in order to hide some series programmaticaly.For example, you can hide or show all of the series by simply setting all of the indexes in the array:
In the Controller:
Of course, when you deselect a series from within the Highcharts chart, the array is automatically updated as well.