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

This commit is contained in:
Igor Kulikov 2017-04-17 20:45:29 +03:00
parent 42613b39d2
commit 122e52e24e

View File

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