Hi @anz.fin.all.mailbox,
Regarding the tm1-color-scheme, in a way that is because it expecting an array object, and not a String.
One of the things that you can try to do though is to re-initialize the directive and pass it with the correct color array on initialization. Below is an example.
The parameter you pass into that will now look like:
tm1-color-scheme="selectedColorArray"
Where the selectedColorArray is:
$scope.selectedColorArray = [];
$scope.selectedColorArray.push($scope.kpi.Colour);
And that property is not being watched by the directive. So one way you can go about it is via ng-if and some function that will set the value on/off when updated:
tm1-color-scheme="selectedColorArray" ng-if="showChart"
Where on the controller side, you have a function that you will call, whenever you wanted to change the color:
$scope.onColorUpdate = function(){
$scope.showChart = false; // this is to remove the directive from DOM
$scope.selectedColorArray.length = 0;
$scope.selectedColorArray.push($scope.kpi.Colour);
$timeout(function(){
$scope.showChart = true; // this is to re-insert it back, with the new value of our color array
}, 500);
};
There should be a number of ways to go about it with the above as just to give an idea.
–
Paul