Stacked Bar Graph with Labels

You can create a stacked bar graph and add the individual values for each part of the bar as text over the top.

To generate this graph in Stata, use the following commands:

sysuse auto, clear
generate obsno = _n
collapse obsno, by(foreign rep78)
drop if missing(foreign, rep78)
sort rep78
by rep78: generate sum = sum(obsno)
generate csum = .
summarize rep78
forvalues i = `r(min)'/`r(max)' {
	summarize obsno if `i' == rep78
	replace csum = obsno/`r(sum)' if `i' == rep78
}

graph bar (sum) csum , over(foreign) over(rep78) asyvars stack legend(size(vsmall)) per blabel(bar, position(center) format(%3.1f) color(white)) ytitle("Percent")