Forum Discussion
Stacked bar chart formatting
- 6 years ago
Hi Anonymous ,
Try this:
Steps:
1. Add a calculated column.
Legend = [Category] & [Index]2. Create a table to sort Category in reverse order. Or just use "enter data" to set custom order.
Category = VAR t = DISTINCT ( 'Table'[Category] ) RETURN ADDCOLUMNS ( t, "Order", RANKX ( t, [Category],, DESC, DENSE ) )3. Create a measure.
1 = 14. Create visuals.
- Create a Ribbion visual and change the data color manually, then turn off background.
- Create a Treemap visual.
- Create a text box and enter text "Legend".
- Group.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DataInsights , i created this using python,
however this is not guided by index, here is a bit easier but the script takes wayy too long, so for example in HR 19, the secuence is the following:
where ream up is 1, Wash out 2 and on, on HR 20 the secuence is:
where now 1 is rotate drill and 2 ream up, the problem i am facing is that the secuence only works when i out index as legend but each value has a color whereas i need a color for only the uniques. : (
Anonymous,
I'm not sure how to dynamically change the stack order of each column (may not be possible without a workaround). From what I can see, the first portion of the left column (HR 19) is the largest value (In Slips), and therefore subsequent columns (HR 20) put In Slips as the first portion of the column. This appears to be standard behavior, and I don't see any option to override it.
One last thought--you could browse the custom visuals to see if there's a chart that offers this functionality.