Please check this post (or whole thread)
https://forum.logicmachine.net/showthrea...08#pid2108
The best option is when you add custom class to this element e.g. "color-by-value" and in Custom Javascript you can then add such code:
You must change "1/1/1" to this GA which should change a value.
Instead of "<=" you can change to "==" if you really want value to be equal not a threshold.
Instead of element.style.color you can changing classes e.g. ".red", ".green", ".blue".
https://forum.logicmachine.net/showthrea...08#pid2108
The best option is when you add custom class to this element e.g. "color-by-value" and in Custom Javascript you can then add such code:
Code:
const colorByValue = (obj, type) => {
const {value} = obj;
const className = "color-by-value";
const element = document.querySelector(`.${className}`);
if (value <= 100.002) element.style.color = "red";
else if (value <= 30.05) element.style.color = "green";
else if (value === 0) element.style.color = "blue";
};
grp.listen("1/1/1", colorByValue);
You must change "1/1/1" to this GA which should change a value.
Instead of "<=" you can change to "==" if you really want value to be equal not a threshold.
Instead of element.style.color you can changing classes e.g. ".red", ".green", ".blue".
Done is better than perfect