cartercjb
12-20-2021ETL
Custom Pivot Table Formatting Script
Does anyone know how to update this widget script to achieve the DESIRED format I have outlined in the screenshot? Essentially, I'm looking to make each subsequent row total a different color, rather than all the same.
CURRENT SCRIPT CODE
widget.on("ready",function(w, args) {
var headerBgColor = '#a90a40'; //Header background
var headerFontColor = '#F2F3F2'; //Header Font Color
var footBgColor = '#44546A'; // Pivot Foot (Totals)
var footFontColor = '#F2F3F2'; // Pivot Column (dims)
var colFontColor = '#5690a2';
// Style
var $jx = $(".p-grand-total-head,.p-dim-head,.p-dim-member-head,.p-measure-head", element);
$jx.css('font-size' , '12px');
$jx.css('font-weight' , 'bold');
$jx.css('color' , headerFontColor);
$jx.css('background-color' , headerBgColor);
$jx.css('text-align' , 'center');
$jx.css('vertical-align' , 'middle');
//center values and col
$(".p-value", element).css('text-align', 'center');
$(".p-dim-head", element).css('text-align', 'left');
// row totals
var $jx= $(".p-total-row-val,.p-total-row-head", element);
$jx.css('font-size' , '12px');
$jx.css('font-weight' , 'bold');
$jx.css('color' , footFontColor);
$jx.css('background-color' , footBgColor);
$jx.css('border-top', 'none');
// col
var $jx = $(".p-dim-member", element);
$jx.css('font-size' , '10px');
$jx.css('font-weight' , 'bold');
$jx.css('color' , colFontColor);
$jx.css('text-align' , 'left');
var $jx = $(".p-value", element);
$jx.css('font-size' , '10px');
// boarders
var $jx = $("[fidx]", element);
$jx.css('border-bottom', 'thin solid ' + colFontColor);
$jx.css('border-right', 'thin solid ' + colFontColor);
})
Thank you!