Indicators - Conditionally format secondary value with Up / Down Arrows

widget.on('processresult', function(w, e) {
var options = {
secondaryValue: {
fontFamily: 'Helvetica, sans-serif',
fontWeight: 'bold',
color: 'grey',
fontSizes: {
big: 20,
medium: 15
}
}
};
if(e.result.secondary.data >= 0) {
e.result.secondary.text = '▲' + e.result.secondary.text;
options.secondaryValue.color = '#00FF00';
}
else {
e.result.secondary.text = '▼' + e.result.secondary.text;
options.secondaryValue.color = '#FF0000';
}
w.indicatorInstance.setOptions('numericSimple', options);
});
-
This is a really great script thanks Jay! I have it working on the secondary line but, how would I implement it on an indicator widget's first or primary value. I tried removing the term "secondary", tried replacing it with "primary" and the word "values" (as that is the term used on the left panel, above secondary). None of them seemed to work.
Appreciate any input you might have!
John
-
Here is what I was looking for. Hope it helps any future users.
https://support.sisense.com/hc/en-us/community/posts/221227708-Adding-Conditional-Icons-to-Indicator
-
Hey Denis Malenfant, did you find a solution for your issue? 'Cause I've got the same one. If yes, could you share it, please?
-
Hi Yurii Markov , we are using BloX widget now to do that type of indicator
Please sign in to leave a comment.
Comments
9 comments