Reverse stacking order of column chart relative to x-axis categories

Comments

6 comments

  • Avatar
    Nathan Giusti

    Hey Sven,

    If I understand you correctly, you can reorder the stacking by reordering the values in the left hand panel. 

    Place whichever value you want at the top to the top of the values panel and ones you want at the bottom to the bottom of the values panel. 

    0
    Comment actions Permalink
  • Avatar
    Sven Willenberger

    But that also changes the order of the x-axis legends. I need to reverse the order of column stacking *relative* to the x-axis legend/labels/categories. See attached image where the left stacked column is the order that corresponds with the x-axis and the right column is the desired outcome, without changing the order of the x axis labels.

    0
    Comment actions Permalink
  • Avatar
    Nathan Giusti (Edited )

    Hey Sven

     

    Try this widget script

     

    widget.on('processresult', (el, args) => {
    args.result.legend.reversed=true
    })

     

    It'll reverse the order of the legend. So set your values up in the order you want them displayed in the column chart and this will reverse the legend so it shows the way you want.

    1
    Comment actions Permalink
  • Avatar
    Sven Willenberger

    That did the trick thanks! Now the silly question -- was that mentioned in the SiSense JS API documentation and I simply missed it? or is this one of those "hidden" attributes that one needs to be in on the secret to know about? :P

     

    0
    Comment actions Permalink
  • Avatar
    Nathan Giusti

    Hey Sven, 

    Sisense used Highcharts to build it's charts. Modifications to the charts are done through the Highchart API. 

    Here is where I found the reverse. https://api.highcharts.com/highcharts/legend.reversed

    1
    Comment actions Permalink
  • Avatar
    Sven Willenberger

    Aha! I totally forgot about Highcharts, good call. Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.