Hello, I have been creating some stacked bar charts with the main intention of showing the exact percentages of the variables included in them. To do this, I used the code:
However, the results show the numbers overlapping with each other, which makes the results less intuitive. I wanted to ask if there is some way to display this in a manner that is more visually intuitive.
Code:
gr bar vote_rd vote_ml if class8 == 4 | class8 == 8, percent stack /// over(essround) by(country) blabel(bar, pos(outside))
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float vote_rd byte(vote_ml class8) float essround double country 0 0 7 1 2 0 1 7 1 2 0 0 . 1 2 0 . 6 1 2 1 0 8 1 2 0 . 7 1 2 0 1 5 1 2 0 0 8 1 2 0 0 5 1 2 0 0 8 1 2 0 1 8 1 2 0 0 6 1 2 0 1 4 1 2 1 0 6 1 2 0 0 5 1 2 0 0 5 1 2 0 0 8 1 2 0 0 8 1 2 0 1 7 1 2 1 0 4 1 2 0 . 4 1 2 0 0 . 1 2 0 0 4 1 2 0 1 1 1 2 0 0 7 1 2 0 0 4 1 2 0 0 7 1 2 0 . 4 1 2 1 0 5 1 2 0 0 7 1 2 0 . 8 1 2 0 0 2 1 2 0 1 7 1 2 0 . 4 1 2 1 0 4 1 2 0 1 4 1 2 0 0 4 1 2 0 0 4 1 2 0 1 8 1 2 0 1 5 1 2 1 0 4 1 2 0 0 8 1 2 0 1 6 1 2 0 . 8 1 2 0 1 8 1 2 0 0 7 1 2 1 0 4 1 2 0 1 6 1 2 0 0 7 1 2 0 0 4 1 2 0 1 4 1 2 0 1 5 1 2 0 0 5 1 2 0 0 8 1 2 0 0 8 1 2 0 . 3 1 2 0 0 4 1 2 0 0 2 1 2 0 1 4 1 2 0 0 1 1 2 0 0 7 1 2 0 1 2 1 2 0 . 8 1 2 0 1 5 1 2 0 . 8 1 2 0 0 8 1 2 0 0 6 1 2 0 0 8 1 2 0 0 6 1 2 0 . 7 1 2 0 0 4 1 2 0 . 4 1 2 0 1 4 1 2 0 0 8 1 2 0 0 7 1 2 1 0 8 1 2 0 . 6 1 2 0 0 1 1 2 0 1 7 1 2 0 . 3 1 2 0 0 5 1 2 0 0 7 1 2 0 0 4 1 2 0 . 4 1 2 0 0 6 1 2 0 0 8 1 2 1 0 8 1 2 0 0 4 1 2 0 0 8 1 2 0 . 8 1 2 0 0 4 1 2 0 0 5 1 2 0 0 8 1 2 0 1 8 1 2 0 . 2 1 2 0 0 2 1 2 0 1 4 1 2 0 1 5 1 2 0 0 1 1 2 0 0 4 1 2 end label values class8 class8 label def class8 1 "Self-employed professionals and large employers", modify label def class8 2 "Small business owners", modify label def class8 3 "Technical (semi-)professionals", modify label def class8 4 "Production workers", modify label def class8 5 "(Associate) managers", modify label def class8 6 "Clerks", modify label def class8 7 "Socio-cultural (semi-)professionals", modify label def class8 8 "Service workers", modify label values country country label def country 2 "dk", modify
Comment