Forum Discussion

simon_geoghegan's avatar
simon_geoghegan
Data Storage
08-11-2025

Transform Pivot - Rotate Column Headers

Hi All,

Is there any widget level code that would rotate column headers so that they can be displayed similar to the below:

I have found various bits of script code online but these seem to relate more to changing font colours etc.

Any help would be greatly appreciated!

Regards,

Simon

8 Replies

  • Hello simon_geoghegan​,

    Thank you for reaching out.

    Can you try below script and let me know if this is what you were looking for?

    ====

    widget.on('ready', function() {

     try {

      if (widget.chart && widget.chart.xAxis && widget.chart.xAxis[0]) {

       widget.chart.xAxis[0].update({

        labels: {

         rotation: -45, // Change to -90 for vertical

         align: 'right',

         style: {

          fontSize: '12px'

         }

        }

       });

      }

     } catch (e) {

      console.error('Axis rotation error:', e);

     }

    });

    ======

    How to Customize:

    • rotation: -45 → for slanted labels
    • rotation: -90 → for vertical labels
    • fontSize → change the font size as needed

    How to install the script:

    1. Edit the widget (Bar chart, Column chart, etc.).
    2. Click the three-dot menu > Edit Script.
    3. Paste the code above.
    4. Save and refresh the widget.
  • Hi DRay​ , thanks for your reply.

    Unfortunately that hasn't worked for me.  Have applied but the hospital names within the pivot table below have remained the same I'm afraid.

     

    • DRay's avatar
      DRay
      Admin

      Ok. Thank you for trying. 

      Can you open a support case for this? They will probably want to look at browser logs to figure out why that's not working.

  • Hi simon_geoghegan​,

    Are you able to access the support portal? https://community.sisense.com/category/support/discussions/SupportPortal

  • Hi DRay​ 

    Apologies for the delay.  I have just tried that but unfortunately get an "Access Denied" message:

     

    Regards,

    Simon

  • Thank you for getting back to me. Have you reached out to your account team yet? If not, I can reach out to them for you.

  • Hi DRay​ - we dont have an account team.  We're a customer of a 3rd party that uses Sisense as its analytics option within the system we have procured.

    We have a "builder license" and can create our own visuals etc. but I think anything wider than that (such as having an account team etc.) isnt something we have.

    I have raised a ticket with our vendor instead and asked if they can support with the code needed.

    Regards,

    Simon