04.08.2022, 12:44
Use this, set additional class to color-by-value. Note that this only works in the actual visualization, not in the editor.
Code:
$(function() {
$('.color-by-value').each(function(_, el) {
var addr = $(el).data('object');
if (addr) {
grp.listen(addr, function(obj) {
var value = obj.value, color;
if (value <= 3000) {
color = '#00991E';
}
else if (value <= 5000) {
color = '#FF8C00';
}
else {
color = '#FF0000';
}
$(el).css('color', color);
});
}
});
});