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

Hi All,

 

Note:I am reposting this question in graphics group.

 

I am trying to produce a graph from sgpnel. Please see the attatched to see desired output.

the requirement is to display the N count below the X axis. I am finding a major challenge to do annotation in sgpanel output.

Initially, I displayed N count along the X axis using colaxistable statement in proc sgpanel procedure. but this option will provide us N count inside the graph area, which customer don't want now.

1) Are we able to do annotations to get N count below X axis in sgpanel procedure. 

Please let me know if you need more information.

Any input will help me.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
a_SAS_sin
Obsidian | Level 7

To give the notion that the axiatable not "inside the data area" you just need to create some kind of separation; in the code I sent, if you just had a refline on the Y axis with a value of 140 will give you the idea that the axistable is separated from the chart.

  

Using annotations to exactly place datalabels is quite complex since SGPANEL only allows the values GRAPHPERCENT, GRAPHPIXEL, LAYOUTPERCENT, and LAYOUTPIXEL.

 

Using GTL and SGRender might be a solution, but you asked for sgpanel...

View solution in original post

5 REPLIES 5
ballardw
Super User

Data:  Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

 

Your current Proc Sgpanel code would help.

 

A non-docx document. Some of use won't or can't by organization policy open such from unknown sources.

a_SAS_sin
Obsidian | Level 7

Someting like this?

 

proc sort data=sashelp.cars out=cars;
	by origin;
run;
data cars;
	set cars;
	Dummy=1;
	label dummy='N';
run;

proc sgpanel data=cars ;
	where origin in ('Europe' 'USA');
	panelby origin  ;
	vbox length / category=type nomean nofill ;
	colaxistable type / 
		class=type classdisplay=cluster 
		valueattrs=(size=9pt weight=bold)
		nolabel;
	colaxistable Dummy / 
		valueattrs=(size=9pt) 
		pad=5;
	colaxis display=none;
	rowaxis display=none;
	rowaxis grid minorgrid;
run;
mnithinshetty
Obsidian | Level 7

Yes. But In your example N count is still inside the data area. right. ! it should be completely outside. there are two ways I may think of, I am not sure it is going to meet my expectation, 1)use sgrender procedure and then boxplot template + axis table. 2)need to expand annotations that fit to X labels... I tried second option here, by creating formats which has tick marks label along with N counts and apply the formats colaxis statement using valuesfotmat= option. as of now it dint work as expected. the problem I am facing is I am not able to separate format applications for each panel. Example attached.

a_SAS_sin
Obsidian | Level 7

To give the notion that the axiatable not "inside the data area" you just need to create some kind of separation; in the code I sent, if you just had a refline on the Y axis with a value of 140 will give you the idea that the axistable is separated from the chart.

  

Using annotations to exactly place datalabels is quite complex since SGPANEL only allows the values GRAPHPERCENT, GRAPHPIXEL, LAYOUTPERCENT, and LAYOUTPIXEL.

 

Using GTL and SGRender might be a solution, but you asked for sgpanel...

mnithinshetty
Obsidian | Level 7
I have received a solution for this requirement.
Please see the discussion subject "Annotation in proc SGPANEL" in SAS programming forum.

Thank you for your reply.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 1735 views
  • 3 likes
  • 3 in conversation