update visualize legend to correctly check if it should show

This commit is contained in:
ppisljar 2016-11-23 11:33:06 +01:00
parent ed1b3304e5
commit 9bd80be07a

View file

@ -55,7 +55,7 @@ uiModules.get('kibana')
};
$scope.toggleLegend = function () {
let bwcAddLegend = $scope.renderbot.vislibVis.hasLegend();
let bwcAddLegend = $scope.vis.params.addLegend;
let bwcLegendStateDefault = bwcAddLegend == null ? true : bwcAddLegend;
$scope.open = !$scope.uiState.get('vis.legendOpen', bwcLegendStateDefault);
$scope.uiState.set('vis.legendOpen', $scope.open);
@ -100,8 +100,8 @@ uiModules.get('kibana')
function refresh() {
let vislibVis = $scope.renderbot.vislibVis;
if ($scope.uiState.get('vis.legendOpen') == null && vislibVis.hasLegend()) {
$scope.open = vislibVis.hasLegend();
if ($scope.uiState.get('vis.legendOpen') == null && $scope.vis.params.addLegend != null) {
$scope.open = $scope.vis.params.addLegend;
}
$scope.labels = getLabels($scope.data, vislibVis.visConfigArgs.type);