Commit 122e52e24e6035bd9fd79507f3972eba1de1a7c8
1 parent
42613b39
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 = { | ... | ... |