This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How change objects color at visu
#23
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);
      });
    }
  });
});
Reply


Messages In This Thread
How change objects color at visu - by AlexLV - 17.03.2019, 21:43
RE: How change objects color at visu - by admin - 04.08.2022, 12:44

Forum Jump: