Hi Statalisters,
I would like the bars in the picture below to be sorted in descending order for each id and year. For example, the order should be blue, grey, green, red, and yellow for id 1 year 2005. I tried over(time, sort() descending)but without success.
A simplified version of the code and a data example:

Cheers,
Giovanni
I would like the bars in the picture below to be sorted in descending order for each id and year. For example, the order should be blue, grey, green, red, and yellow for id 1 year 2005. I tried over(time, sort() descending)but without success.
A simplified version of the code and a data example:
Code:
graph bar (sum) y1 y2 y3 y4 y5, over(time) over(id) stack
id time y1 y2 y3 y4 y5 1 2005q4 13.6 0.6 1.6 0.3 4.5 1 2010q4 23.1 0.4 3.4 0.2 6.8 1 2015q4 14.2 0.1 0.1 0.0 1.0 2 2005q4 0.5 0.3 0.1 0.0 1.7 2 2010q4 2.4 0.3 0.8 0.0 2.0 2 2015q4 2.7 0.3 0.1 0.0 1.7
Cheers,
Giovanni
Comment