I am trying to create a stack bar chart in Vegalite.
my requirement is specific i want to stack the bar in the same order as in legend (legend are in order as data ) , i want to stack bar from bottom to top .
in the above chart legend are in same order as my data ["first","Second","third"] but the bar stacking not in same order i.e worng order ["Second","first","third"] but i want ["first","Second","third"] order from top to bottom i.e lower one ->"first","mid"->"Second",top->"third" follow legend order
how i can achieve this in any way?
2
Answers
Add a scale and order: