Forum Discussion
Anonymous
01-06-2023Note: If you have multiple pivot tables in your dashboard, put this inside the initialized event of the widget and declare columnsToHide as a const variable.
widget.on('initialized', function (ev, se) {
const columnsToHide = [3,4]
widget.transformPivot(
{},
function (metadata, cell)
{
columnsToHide.forEach(function(col) {
if (metadata.colIndex == col-1) { // Add a second condition ( && metadata.rowIndex > 0 ) if you want to keep the table header
cell.content = ' '
cell.style = {
maxWidth: '0px',
borderColor: 'white',
color: 'white'
}
}
})
}
);
});