Pentaho

 View Only

 multi bar chart and series display order in the legend

  • Pentaho
  • Ctools
  • Pentaho
Marvin Horst's profile image
Marvin Horst posted 09-26-2019 21:58

I have a multi bar chart where the displayed bars are shown in the opposite order, from left to right, compared to how the series are displayed in the legend. This seems counterintuitive to me. (see image)

 

Is there a setting available to change this?

 

gmroi snip


#Pentaho
#Ctools
Paulo Pires's profile image
Paulo Pires

I think that the legend is sorted alphabetically and the bars are according the json columns order.

Can you test it and change the order of the output to match the legend?

Marvin Horst's profile image
Marvin Horst

Here's the debug for the original chart order.

ccc1

 

 

Switched the series order

ccc2

 

 

and the debug output

ccc3

 

Seems like the legend always displays in the opposite order.

Duarte Cunha Leao's profile image
Duarte Cunha Leao

In fact, that's not expected.

By default, both the legend and the bars should use the order present in the data: "avg inventory" followed by "annualized margin".

 

Could you have specified some option which inverts the legend or bar order? Could you share the log with extra information, in particular, having "?debugLevel = 5 " in the URL?

 

Cheers

Duarte Cunha Leao's profile image
Duarte Cunha Leao

I managed to switch the order in the data...

I meant "annualized margin" followed by "avg inventory".

Also, use at least 10 in the debugLevel

 

;-)

Marvin Horst's profile image
Marvin Horst

I configured the series in the original order.

 

See attachment for the debug

 

Marvin Horst's profile image
Marvin Horst

I think I've found it

 

colorRole: "series desc",

 

I changed it to

 

colorRole: "series asc",

 

This was buried in a function I used for templating a Bar chart. Don't even know why I initially set this.

 

Thanks for responding!