Change color of data bars in pivot

Comments

3 comments

  • Avatar
    Joseph Peters

    Can this code be modified to allow conditional formatting?  For instance green if + and red if -?

    0
    Comment actions Permalink
  • Avatar
    Sam Ovenshine

    For multiple pivot table columns with data bars and a different color for each, please use the following script:

    widget.on("ready",function(se,ev){
    $(".databar[fidx=2] .bar-container .bar").css('background-color', 'red');
    $(".databar[fidx=3] .bar-container .bar").css('background-color', 'blue');
    });

    Update the value for fidx to the index of your column. Columns are 0-indexed. For example, to modify the data bar in the fourth column of your pivot table, use fidx=3.

    0
    Comment actions Permalink

Please sign in to leave a comment.