BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ANLYNG
Pyrite | Level 9

Hi,

I am stuck on this problem. I want to make a stacked plot with is grouped (name A and Name B). But it seems to double the

headers on the x-axis(show emty header B on A and opposite). Please see the attachment (the left most part and the right most part). I os only the headers and not the values. How can I show only the headers with vbars? and not headers from B on A and not headers A on B.

 

Hope ypu have some ideas.

 

here is my code:

 

proc sgpanel data=plot;

;

styleattrs datacolors=(red green blue);

panelby Name;

 

vbar group_var_sort / response=measure group=_NAME_ barwidth=1

           dataskin=pressed baselineattrs=(thickness=0) datalabel seglabel;

colaxis display=(nolabel noticks) valueattrs=(size=7);

rowaxis label='Pct' values=(0 to 60 by 10) grid;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

The axis value label duplication could be caused by the format associated with variable group_var_sort. Add the statement

 

format group_var_sort $6.;

 

to the sgpanel procedure and see what happens. 

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

The axis value label duplication could be caused by the format associated with variable group_var_sort. Add the statement

 

format group_var_sort $6.;

 

to the sgpanel procedure and see what happens. 

PG
ANLYNG
Pyrite | Level 9

yes-you are right-they need to be exact the same-thanks.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 879 views
  • 0 likes
  • 2 in conversation