Pivot Table Lines Extend Beyond Table

Comments

3 comments

  • Avatar
    Malinda Jepsen

    You can use this JavaScript in the widget to hide them:


    widget.on("domready", function(w){
    var tags = $('td.phantom', element);
    for(var i=0; i<tags.length; i++) {
    tags[i].style.width = '0px';
    }
    })

    1
    Comment actions Permalink
  • Avatar
    Jessica Orlando

    Hi Malinda,

     

    This is exactly what I needed! Thank you!

     

    I still wish this would not happen as it seems to be a flaw in the design of the dashboard, but we will use the script in the meantime.

     

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Elliott Herz

    Hey Jessica,

     

    You can also use this script, which will dynamically expand the width of the fields to take up the entire space of the pivot:

     

    // Export to PDF will not execute the script...so pivot will render as if there was no script
    widget.on("domready", function(w, args){
    var tag = $('tr#pivot__ACCRowArea', element)[0];
    var numGroups = $('td.p-dim-head', tag).length;
    var tagWidth = tag.offsetWidth;
    var numCols = tag.children.length;
    var pivotWidth = $("div.p-fixed-rows", element)[0].offsetWidth;
    var groupWidth = 0;

    if(pivotWidth > tagWidth) {
    for(var i=0; i<numCols; i++) {
    if(i < numGroups) {
    groupWidth += (Math.trunc(tag.children[i].offsetWidth * pivotWidth / tagWidth));
    }
    $('[fidx=' + i + ']', element).width(Math.trunc(tag.children[i].offsetWidth * pivotWidth / tagWidth));
    }
    $(".p-fixed-cols", element).width(groupWidth);
    $(".p-fixed-corner", element).width(groupWidth);
    $("td.phantom", element).width(0);
    }
    else {
    console.log("script couldn't execute as their wasn't enough space to expand the pivot");
    }
    })

    Best,
    Elliott
    1
    Comment actions Permalink

Please sign in to leave a comment.