Hi,
I'm generating a stacked bar chart using the code below. I would like to remove labels with 0 values from the bar.
As a result, I'm getting the chart below:
I'm generating a stacked bar chart using the code below. I would like to remove labels with 0 values from the bar.
Code:
* -- Stacked bar chart --.
graph bar variables*, ///
over(laname, sort(1) descending label(labsize(vsmall) angle(90))) ///
bar(6, bcolor(gray)) ///
lines(lwidth(thin) lpattern(solid)) ///
ytitle("% ", size(small) margin(vsmall)) ///
ylabel(, labsize(vsmall) angle(horizontal) ) ///
plotregion(lstyle(none)) ///
lines(lwidth(vthin)) ///
title("Title", size(medsmall) position(12) margin(vsmall)) ///
subtitle("{it: Geo}", size(small) position(12)) ///
caption("{it: Data source: Source}", ///
size(vsmall)) ///
note("Note.", size(vsmall)) ///
stack percent ///
legend(order( 1 "1" 2 "2" ///
3 "3" 4 "4" ///
5 "5" 6 "6") ///
rows(2) cols(3) size(vsmall) ///
position(6) rowgap(.5) region(fcolor(white) lcolor(black))) ///
blabel(bar, position(center) format(%9.0f) color(black) ///
orientation(vertical) size(vsmall)) ///
name(graph, replace)

Comment