I am trying to add two bar labels to this frequency hbar graph. One with the totals of each category inside each bar and another label outside with the name of the category. But the code is only choosing to pick one barlabel, group or bar but not both.
Honestly, just the label is probably enough from purely data depiction purposes, but I was curious if there is an option.
graph hbar (count), over(dcat, sort(1) label(nolabels)) blabel(group) ///
title("Frequencies of breast hematopoietic neoplasm") ///
subtitle("Between 2000-2021") ///
blabel(bar, position(inside) format(%9.0f) color(white)) ///
note("Most of these were diagnosed on needle core biopsies")
graph export Vickerybar.png, replace
Honestly, just the label is probably enough from purely data depiction purposes, but I was curious if there is an option.
graph hbar (count), over(dcat, sort(1) label(nolabels)) blabel(group) ///
title("Frequencies of breast hematopoietic neoplasm") ///
subtitle("Between 2000-2021") ///
blabel(bar, position(inside) format(%9.0f) color(white)) ///
note("Most of these were diagnosed on needle core biopsies")
graph export Vickerybar.png, replace
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte obs str28 dcat 1 "PTCL, NOS" 2 "DLBCL" 3 "MZL" 4 "DLBCL" 5 "MZL" 6 "MZL" 7 "FL" 8 "DLBCL" 9 "FL" 10 "MZL" 11 "FL" 12 "MZL" 13 "MZL" 14 "DLBCL" 15 "FL" 16 "DLBCL" 17 "MZL" 18 "CLL/SLL" 19 "DLBCL" 20 "DLBCL" 21 "MZL" 22 "DLBCL" 23 "FL" 24 "DLBCL" 25 "MZL" 26 "B-lymphoblastic" 27 "ALCL, ALK+" 28 "MZL" 29 "HGBCL, NOS" 30 "HGBCL, NOS" 31 "MZL" 32 "MZL" 33 "DLBCL" 34 "Mycosis Fungoides" 35 "DLBCL" 36 "MZL" 37 "Histiocytic Sarcoma" 38 "CLL/SLL" 39 "MZL" 40 "Extramedullary myeloid Tumor" 41 "DLBCL" 42 "FL" 43 "T-lymphoblastic" 44 "DLBCL" 45 "MZL" 46 "DLBCL" 47 "MZL" 48 "MZL" 49 "FL" 50 "DLBCL" 51 "DLBCL" 52 "B-lymphoblastic" 53 "FL" 54 "DLBCL" 55 "DLBCL" 56 "MZL" 57 "CLL/SLL" 58 "MZL" 59 "FL" end

Comment