cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member

This Script Is Created To Center The Pivot Table Inside The Dashboard Widget.

Instead of Pivot Table being anchored to the top left,  you can use this script to make the pivot centered both vertically and horizontally.
Please note, this working only for "Pivot Table widget" with version 1.

STEP-BY-STEP GUIDE:

  1. Open a pivot widget in Sisense dashboard and go to 'Edit Script'
  2. Copypaste the below script and press save button
  3. Test the results, see how a Pivot table is centered in your screen
  4. Feel free to modify values in the script "margin-left" and "margin-top" to make the Pivot in the right position
Script:
widget.on('ready', function(widget) {
var widgetContainer = $('[widgetid="'+ widget.oid + '"]')
if (prism.$ngscope.appstate === "dashboard") {
$('[widgetid="'+ widget.oid + '"]').find(document.getElementsByClassName('p-container')).css('margin-left', '25%') .css('margin-top', '10%')
} else if (prism.$ngscope.appstate === "widget") {
$(document.getElementsByClassName('p-container')).css('margin-left', '25%').css('margin-top', '10%')
}
})

widget.on('domready', function(widget) {
var widgetContainer = $('[widgetid="'+ widget.oid + '"]')
if (prism.$ngscope.appstate === "dashboard") {
$('[widgetid="'+ widget.oid + '"]').find(document.getElementsByClassName('phantom')).remove()
} else if (prism.$ngscope.appstate === "widget") {
$(document.getElementsByClassName('phantom')).remove()
}
})

THIS IS HOW IT LOOKS LIKE:

Comments
MarkZither
7 - Data Storage
7 - Data Storage

If you are looking for this for Pivot Table 2 change the lines with getElementsByClassName('p-container') such as

$('[widgetid="'+ widget.oid + '"]').find(document.getElementsByClassName('p-container')).css('margin-left', '25%') .css('margin-top', '10%')

to use pivot-container

$('[widgetid="'+ widget.oid + '"]').find(document.getElementsByClassName('pivot-container')).css('margin-left', '25%') .css('margin-top', '10%')

 

Version history
Last update:
‎03-02-2023 09:05 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: