BookmarkSubscribeRSS Feed
Lopa2016
Fluorite | Level 6

I have a 12 month data starting from Nov12 to Nov13 with which I intend to build 3d bar diagrams. However proc gcchart is not printing all the 12 months.Is there a syntax to specify to print all?

proc gchart data=work.new3;
vbar3D use_date /sumvar=Count sum
subgroup=status_pr_end width=5 INSIDE=SUM ;
/* by year descending;*/
run;
quit;

 

Thanks in advance!!

7 REPLIES 7
Lopa2016
Fluorite | Level 6

I have a 12 month data starting from Nov12 to Nov13 with which I intend to build 3d bar diagrams. However proc gcchart is not printing all the 12 months.Is there a syntax to specify to print all?

 

proc gchart data=work.new3;
vbar3D use_date /sumvar=Count sum
subgroup=status_pr_end width=5 INSIDE=SUM ;
/* by year descending;*/
run;
quit;

 

Thanks in advance!!

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, I would suggest move to sgplot/gtl which is the modern incarnation of the graphing system in SAS.  You can find examples of all types here:

http://blogs.sas.com/content/graphicallyspeaking/

 

With this you just use the: values=

To specify what you want on the axis.  

Lopa2016
Fluorite | Level 6

Thanks for your suggestion I have figured out the following solution:

 

axis1 order=('NOV15' 'DEC15' 'JAN16' 'FEB16' 'MAR16' 'APR16' 'MAY16' 'JUN16' 'JUL16' 'AUG16' 'SEP16'
'OCT16''NOV16' 'DEC16');
proc gchart data=work.new3;
vbar chardate /sumvar=Count sum
subgroup=status_pr_end width=5 maxis=axis1 ;

run;
quit;

ballardw
Super User

I strongly urge you to consider using actual DATE values and not character for use with graphing procedures. The sort order for months will always require an explict list either an AXIS order option or XAXIS values list. SAS date values will 1) sort in expected order 2) allow changing axis displayed values with built-in SAS procedures 3) allows specifying tick marcs with order/ value options like '01NOV2015'd to '01DEC2016'd by month

Lopa2016
Fluorite | Level 6

But how to use a stagger option with the SAS dates in place ? For eg  I have used the SAS dates the month labels on the x axis are appearing inverted . On contrary I would like the labels to shrink in terms of the font size. Do you have some reading material that I can quite browse through?

 

Thanks in advance !!

 

 
ballardw
Super User

The online documentation or search for "gchart axis" at http://support.sas.com/en/technical-support.html

 

AXIS statement will allow you to set the font size, formats to display values. With actual dates you might use MONYY5. or mmyy4. or mmyys5. to get different appearance for the date.

GraphGuy
Meteorite | Level 14

Here's an example showing how to do this using Proc Gchart, and real date values:

 

 

data mydata; set sashelp.stocks (where=(stock='IBM' and date>='01nov1999'd));
my_year=.; my_year=year(date+70);
run;
proc sort data=mydata out=mydata;
by my_year date;
run;
goptions gunit=pct htitle=4 htext=2.5;

options nobyline;
title1 "Stock volume for IBM in year #byval(my_year)";
proc gchart data=mydata;
format date monyy5.;
label date='Month';
by my_year;
vbar date / discrete type=sum sumvar=volume;
run;

 

 

ibm04.png

 

ibm05.png

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
  • 7 replies
  • 979 views
  • 0 likes
  • 4 in conversation