Commit 12f0fd6c9a9f00eb19b7c59a341d71145e581eef
Committed by
mp-loki
1 parent
c9a8ddb1
TB-52: Fix improper legend values selection/deselection for multiple datasources.
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -341,6 +341,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q |
341 | 341 | $scope.legendConfig.showTotal === true); |
342 | 342 | |
343 | 343 | if (widget.type !== types.widgetType.rpc.value && widget.type !== types.widgetType.static.value) { |
344 | + var dataIndex = 0; | |
344 | 345 | for (var i = 0; i < widgetContext.datasources.length; i++) { |
345 | 346 | var datasource = widgetContext.datasources[i]; |
346 | 347 | for (var a = 0; a < datasource.dataKeys.length; a++) { |
... | ... | @@ -356,7 +357,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q |
356 | 357 | if ($scope.displayLegend) { |
357 | 358 | var legendKey = { |
358 | 359 | dataKey: dataKey, |
359 | - dataIndex: Number(i) + Number(a) | |
360 | + dataIndex: dataIndex++ | |
360 | 361 | }; |
361 | 362 | $scope.legendData.keys.push(legendKey); |
362 | 363 | var legendKeyData = { | ... | ... |