Commit 12f0fd6c9a9f00eb19b7c59a341d71145e581eef

Authored by Igor Kulikov
Committed by mp-loki
1 parent c9a8ddb1

TB-52: Fix improper legend values selection/deselection for multiple datasources.

@@ -341,6 +341,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q @@ -341,6 +341,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
341 $scope.legendConfig.showTotal === true); 341 $scope.legendConfig.showTotal === true);
342 342
343 if (widget.type !== types.widgetType.rpc.value && widget.type !== types.widgetType.static.value) { 343 if (widget.type !== types.widgetType.rpc.value && widget.type !== types.widgetType.static.value) {
  344 + var dataIndex = 0;
344 for (var i = 0; i < widgetContext.datasources.length; i++) { 345 for (var i = 0; i < widgetContext.datasources.length; i++) {
345 var datasource = widgetContext.datasources[i]; 346 var datasource = widgetContext.datasources[i];
346 for (var a = 0; a < datasource.dataKeys.length; a++) { 347 for (var a = 0; a < datasource.dataKeys.length; a++) {
@@ -356,7 +357,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q @@ -356,7 +357,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
356 if ($scope.displayLegend) { 357 if ($scope.displayLegend) {
357 var legendKey = { 358 var legendKey = {
358 dataKey: dataKey, 359 dataKey: dataKey,
359 - dataIndex: Number(i) + Number(a) 360 + dataIndex: dataIndex++
360 }; 361 };
361 $scope.legendData.keys.push(legendKey); 362 $scope.legendData.keys.push(legendKey);
362 var legendKeyData = { 363 var legendKeyData = {