javascript - Conditional Formatting in Angular -




here conditional formatting feature in microsoft excel color bars represent percentage in comparing highest value.

conditional formatting in excel

is there anyway achieve html5 using either css or javascript? or maybe using additional angular library well.

i'm thinking using clip-path feature may not supported on browsers

do mean this?

you can simple in vanillajs. must elements

const elnodes = document.queryselectorall('.element'); const elements = [...elnodes]; 

get values , find max value

const elementsvalues = elements.map((el) => parsefloat(el.children[1].textcontent)); const maxvalue = math.max(...elementsvalues); 

finally change width of elements based on value:

elements.foreach((el) => {     el.children[0].style.width = 100 / (maxvalue / parsefloat(el.children[1].textcontent)) + '%'; }); 




wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

Jenkins: find build number for git commit -

firebase - How to wait value in Ionic 2 -