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.

BAR CHANGE SIZE 0 to 100%
#6
No Custom CSS is needed, just add Custom JavaScript and set Additional classes property to bar for all required visualization elements. Objects must have 1-byte scale (0..100%) data type to work properly.

Another option is to use clip-path property so icon is clipped from the top instead of from the bottom as in the previous example. Make sure that only one script is used at a time.
Code:
$(function(){
  if (typeof grp == 'undefined') {
    return;
  }
  
  $('.bar').each(function(_, wrapel) {
    var wrap = $(wrapel);
    var addr = wrap.data('object');
    var el = wrap.find('.icon').css('transition', 'clip-path 1s linear');

    grp.listen(addr, function(object) {
      el.css('clip-path', 'inset(' + (100 - object.value) + '% 0 0 0)')
    }, true);
  });
});
Reply


Messages In This Thread
BAR CHANGE SIZE 0 to 100% - by Acla - 19.02.2021, 18:12
RE: BAR CHANGE SIZE 0 to 100% - by admin - 22.02.2021, 08:26
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 24.02.2021, 09:33
RE: BAR CHANGE SIZE 0 to 100% - by admin - 24.02.2021, 11:00
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 25.02.2021, 09:27
RE: BAR CHANGE SIZE 0 to 100% - by admin - 25.02.2021, 10:21
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 28.02.2021, 11:43
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 28.02.2021, 18:41
RE: BAR CHANGE SIZE 0 to 100% - by admin - 01.03.2021, 08:24
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 01.03.2021, 18:30
RE: BAR CHANGE SIZE 0 to 100% - by admin - 02.03.2021, 07:21

Forum Jump: