Change color for specific box


#1

Hello, I want to change the background color of an specific level of my org chart but I only can change the background color of all boxes.
How can I do this?

Thanks,
Cristina


#2

Hello @Cristina,

Unfortunately, it’s not possible to change a color of the boxes on a specific level, but you can change the color of boxes of specific users. Thus, you can get the result you are looking for by coloring the boxes of all the user on a specific level. To change the background color conditionally please add a script like this in the Custom JavaScript tab:

renderer.onBoxRendered(function(event, box, itemData){
  if (itemData["AccountName"].contains("[email protected]") || itemData["AccountName"].contains("[email protected]")){
    box.$elem.addClass("custom-class").css({'background': 'yellow'});
  }
});

Anna Dorokhova
Plumsail Team