How to Apply styles dynamically based on attribute values

0
Hi All,   I have a list. Based upon attribute value i need to display that value in colors . ex: my 1. attribute value <0 i need dispaly that value in 'Red' color            2. value >5 i need to dispaly 'blue '   Thank, RK>      
asked
2 answers
5

Hi Raja,

There's an option for dynamic class in the styling tab of each widget.

What you can do is, you can write multiple SCSS classes in your styling SCSS files.

lets assume :

.classRed{
background-color: red;
}
.classGreen{
background-color: green;
}
.classYellow{
background-color: green;
}

Now, in the Dynamic Class part,

you can write something like this:

 

if $entity/Attribute=0 then 'classRed' else if $entity/Attribute<5 then 'classGreen' else 'classYellow'

 

Let me know, if you have any issues,

Hope it helps!

answered
0

Hi @Rishabh Shandilya,

Getting below expression errors.

 

image.png

answered