Hi,
I have added emoji's in my dashboard based on the expression.
Based on the percentage it has to show smiley with color as green and red.
Here i have written one method in javascript
function setColors(args) {
var textClientData = DashboardViewer.GetItemData("textBoxDashboardItem1");
var value = textClientData.GetMeasureValue(textClientData.GetMeasures()[2].Id).GetValue();
if (value=="J")
var result = value.toString().fontcolor("Green");
document.getElementsByClassName('cs10E8CA05').css('color','Green');
};
If the value is J then it has to be in green color.
If the value is L then it has to be in red color.
I have checked the network tab in browser and it is lying under the span.
How to set color for the span by using javascript call to css.
Please suggest me.
What I have tried:
function setColors(args) {
var textClientData = DashboardViewer.GetItemData("textBoxDashboardItem1");
var value = textClientData.GetMeasureValue(textClientData.GetMeasures()[2].Id).GetValue();
if (value=="J")
var result = value.toString().fontcolor("Green");
document.getElementsByClassName('cs10E8CA05').css('color','Green');
};
This is HTML
<span class="cs10E8CA05">L</span>
<span class="cs10E8CA05">J</span>