Dear All,
I am creating a bar chart using the following dataset:
Here is the code for the bar chart, which looks as expected and serves the purpose:
I would like to add value labels (up to 2 decimal places), displaying the height of each bar at the top of each bar. For instance, at the top of disp0 bar for Asian it would say "0.75". Any help with editing to above code to add the value labels on top of each bar would be greatly appreciated.
Many thanks in advance for your help.
Gratefully,
Sumedha
I am creating a bar chart using the following dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long type float(type0 disp0 disp1) 1 .75 .7627072 .7905607 2 1.75 1.0727396 1.1185094 3 2.75 1.0815755 1.0576259 end label values type type label def type 1 "Asian", modify label def type 2 "Black", modify label def type 3 "Hispanic", modify
Code:
twoway (bar disp0 type0, barwidth(.25) color(khaki)) || /// (bar disp1 type, barwidth(.25) color (navy)), /// legend(order(1 "New MCI/ADRD dx per 100 without treatment" 2 "New MCI/ADRD dx per 100 with treatment") pos(6)) /// xlabel(.88 "Asian" 1.88 "Black" 2.88 "Hispanic" ) ylabel(.7(.1)1.2, valuelabel labsize(2.5)) yline(1, lcolor(cranberry))
Many thanks in advance for your help.
Gratefully,
Sumedha
Comment