BookmarkSubscribeRSS Feed
fredbell
Fluorite | Level 6
Hello everyone!

I would like to add the date to the x axis in the below code, how would i do that?
Basically i would like to see in x axis each day in the date range and the Call_type, Sum of Calls_handled in y axis.


proc chart data = Call_type_technical;
VBAR Call_type /SUMVAR = CALLS_HANDLED TYPE= SUM;
run;

Thanks

Fred
9 REPLIES 9
GraphGuy
Meteorite | Level 14
Perhaps something like this...

proc chart data = Call_type_technical;
VBAR date / discrete
subgroup=Call_type
SUMVAR=CALLS_HANDLED TYPE= SUM;
run;
fredbell
Fluorite | Level 6
Thanks Robert

Is it possible to have a bar for each Call_type instead of on top of each other?

Fred
GraphGuy
Meteorite | Level 14
You could use a 'grouped' bar chart (but there are some caveats you might run into)...

The code would be something like:

proc chart data = Call_type_technical;
VBAR Call_type / discrete
group=date
SUMVAR=CALLS_HANDLED TYPE= SUM;
run;
fredbell
Fluorite | Level 6
Thank you Robert this will help a lot with my analysis.

Fred
Cynthia_sas
SAS Super FREQ
Just curious...won't PROC GCHART look better???

;-)
cynthia
fredbell
Fluorite | Level 6
Hi Cynthia

Yes that is what i ended up doing, see code below.
Thanks for the input.

/* Technical Set the graphics environment */
/* Create Graph of Calls Handled Technical */

/* Email HTM File to Distribution List */
goptions reset=all device=activex xpixels=950;


/* Specify the path and filename of the output file. */

filename odsout '\\***************************************\';


/* Open the ODS HTML output destination */

ods html file='Information.html' path=odsout style=Statistical;


title 'Information';

/* use the SHAPE= option to specify a cylinder */

axis1 value=(height=8pt angle=90);
axis2 label=(angle=90 rotate=0);

proc gchart data=Call_Type_Tech noprint;
vbar3d date /width =10 sumvar=calls_handled discrete raxis=axis1 shape=cylinder
subgroup=call_type
group=call_type
cframe=yellow autoref width=2;
run;
quit;

Fred
Cynthia_sas
SAS Super FREQ
Hi:
Are you getting an error on the NOPRINT option?
[pre]
527 proc gchart data=xxxxxxx_yyyyyyy noprint;
-------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ANNOTATE, DATA, GOUT, IMAGEMAP.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
[/pre]

Other than that, the CFRAME=YELLOW hurts my eyes, but perhaps your viewers have younger eyes that aren't as sensitive to colors like that.

cynthia
fredbell
Fluorite | Level 6
I have since removed the noprint.

I do have a question regarding Goption Device = gif;
instead of goption reset = all device = active x;

I have changed my code to Goption Device = gif; so i could drilldown but it now appears that i can't hover over bars with my mouse and see the totals for each group were this was the case with goption reset = all device = active x;

Code below

goptions device=gif gsfname=image gsfmode=append display;
ODS LISTING CLOSE;

/* Specify the path and filename of the output file. */

filename odsout '\\mtrl\Int_ss$\vali_esource_vs_destination\';


/* Open the ODS HTML output destination */

ods html file='Calls Handled.html' path=odsout style=Statistical;


title 'Calls Handled ';
footnote1 color=Black "(Click Blue #1 Drilldown to Technical #2 Green for Service #3 Yellow for Sales & Retention)";
footnote2 color=Red "(# 4 Calls that are not assigned to Group, no drilldown available)";

/* use the SHAPE= option to specify a cylinder */

axis1 value=(height=8pt angle=90);
axis2 label=(angle=90 rotate=0);

proc gchart data=neworg_callshandle_by_day;
vbar3d date /discrete subgroup = color width =10 sumvar=calls_handled discrete raxis=axis1 shape=cylinder
subgroup=Group
maxis=axis1
raxis=axis2
autoref cref=gray
clipref
coutline=black
legend=legend1
html_legend=htmlvar
cframe=white autoref width=2;
run;
quit;

ods html close;

Any suggestions as it would be good to see that info

thanks

Fred
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You need HTML= parameter and add corresponding SAS variable from your input file to display the ALT= text.

Sample 25247: Produce a graph with chart tips and drill down capabilities
http://support.sas.com/kb/25/247.html


Scott Barry
SBBWorks, Inc. Message was edited by: sbb

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 2039 views
  • 0 likes
  • 4 in conversation