I am building a variable width bar chart (I am attempting to use proc gareabar for the first time).
The example here is great:
https://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#a002299562.htm
However, I want to remove the data labels. (I do not want 27, 80, or 46 to show up on the graph). The method I have used for removing data labels for other procedures is not working for this procedure.
Any suggestions would be greatly appreciated.
goptions reset=all dev=activex;
data totals;
input Site $ Quarter Sales Salespersons;
format Sales dollar12.2;
datalines;
Lima 1 4043.97 4
NY 1 8225.26 12
Rome 1 3543.97 6
Lima 2 3723.44 5
NY 2 8595.07 18
Rome 2 5558.29 10
Lima 3 4437.96 8
NY 3 9847.91 24
Rome 3 6789.85 14
Lima 4 6065.57 10
NY 4 11388.51 26
Rome 4 8509.08 16
;
ods listing close;
ods html;
proc gareabar data=totals;
vbar site*salespersons /
sumvar=sales;
run;
quit;
ods html close;
ods listing;
I do not know of a way to programmatically remove these labels [perhaps there's an html parameter that could be set, such as the following, but I don't see anything documented: ODS HTML parameters=("show_area_labels"="false"); ]
Since this is an interactive activex chart, you can right-click and run the "Graph properties" menu, and then select the "Area bar" tab, and un-check the "Show labels" checkbox ... for a one-time view of the chart the way you're wanting it.
Hi,
Well, never heard of this procedure before, I would always use either proc sgplot, or Graph Template Language. Preferable GTL. Then you have full functionality to alter labels and what comes out. Check out this blog which has examples of pretty much anything you could want to do with graphs:
http://blogs.sas.com/content/graphicallyspeaking/
You should find plenty of examples where bar charts are done, with adding data labels, or other things.
I do not know of a way to programmatically remove these labels [perhaps there's an html parameter that could be set, such as the following, but I don't see anything documented: ODS HTML parameters=("show_area_labels"="false"); ]
Since this is an interactive activex chart, you can right-click and run the "Graph properties" menu, and then select the "Area bar" tab, and un-check the "Show labels" checkbox ... for a one-time view of the chart the way you're wanting it.
That does what I need it to do.
Thank you!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.