BookmarkSubscribeRSS Feed
MiroTrindade
Calcite | Level 5

Hi people!

 

Is it possible to build bar charts with the data label results in percentage and frequency at the same time?

 tr.png

This is a pie chart but is it possible with bar charts?

 

Thanks for any help!

6 REPLIES 6
Reeza
Super User

Your subject and question are very different. What's your question?

MiroTrindade
Calcite | Level 5
Sorry. I made a mistake In the subject. The question is actually the same, if it's possible to draw a bar chart with the label value in percentage and freq (in the same chart). Like the example I posted. Thanks.
Reeza
Super User

If you precalculate the labels then then you can use that variable in the datalabel statement. 

 

You coukd plot two two identical series, but make one 100% transparent. 

 

Or you could try GTL for different options. 

 

Were you thinking of using HBAR, HBARBASIC, OR HBARPARM? 

MiroTrindade
Calcite | Level 5
Hi Reeza!

I´m using HBAR and VBAR.
Jay54
Meteorite | Level 14

One way is to overlay a TEXT or SCATTER (with Markerchar) on the bar.  To allow overlays, you have to use a VBARPARM or VBARBASIC.  If you compute your values before hand, and put the freq and % vaues in different columns, yuu can use VBARPARM with DATALABEL to display the response value and display the 2nd value using a TEXT (SAS 9.40M2) plot layer.  If you do not have SAS 9.40M2, use the SCATTER for overlay.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1679 views
  • 0 likes
  • 4 in conversation