Desktop productivity for business analysts and programmers

proc gchart

Reply
Super Contributor
Super Contributor
Posts: 318

proc gchart

hello friends, please help me to set weekly report and sent it to team.

Step1 -> below excel sheet i am going to update manually on weekly bases

step2 -> wants to use proc gchart to generate bar chart which would have "percent_run_fine" on vertical line and "wk_2015" on horizontal line

                 I wants to show "even week" in blue color and "odd week" in orange color.        

step3-> after report generation - want to create link for team so that they can see report every Monday

step4 -> going to add this is sas automation

WK_2015Run_fineTot_jobsPercent_run_fine
wk1129213.04
wk2559259.78
wk3909297.83
wk4909297.83
wk5
wk6
wk7
Grand Advisor
Posts: 10,223

Re: proc gchart

How many "weeks" will you be showing and what physical size will that display be? I ask as if you are going to show 52 weeks and try to fit it into a 4in wide display then you have less than .08 inches width to display the text for the week.

Output destination is which of Html, PDF, RTF?

Where are you going to have a link? It may be easiest to set the link once and then replace the target destination with the output of this.

Does it have to be GChart output or would another graph work>

Which version of SAS / EG will this be created on?

Super Contributor
Super Contributor
Posts: 318

Re: proc gchart

How many "weeks" will you be showing and what physical size will that display be?  I ask as if you are going to show 52 weeks and try to fit it into a 4in wide display then you have less than .08 inches width to display the text for the week. - yes complete 2015 year, 52 wk

Output destination is which of Html, PDF, RTF? - PDF

Where are you going to have a link? It may be easiest to set the link once and then replace the target destination with the output of this. - yes, agreed

Does it have to be GChart output or would another graph work> i am using below code as of now but if u suggest new way of doing i can work on it Smiley Happy

proc import datafile="F:\SHARES\woo\xyz.xls"

out=abc

dbms=excel replace;

run;

title "WEEKEND REPORT";

proc gchart data=work abc;

   vbar wk_2015 / sumvar=percent_run_fine annotate=kpi patternid=midpoint width=10;

run;

quit;

Which version of SAS / EG will this be created on? - 4.1 EG/9.1 SAS

Grand Advisor
Posts: 10,223

Re: proc gchart

You're likely to spend some time getting the AXIS statement to do quite what you want. I would make an axis so that it represents the whole year and as weeks are added to the data the change in the display is the appearance of the latest bar and the associated annotate information.

You'll start with something like

Axis1 order = ("wk1" "wk2" ..... "wk52"); The values here have to match the values in the data set, case and everything. Since this would be a character value you will need ORDER to keep them from appearing as wk1 wk10 ..wk19 wk2 wk20 ..

UNLESS the week values were actually wk01 wk02.

If you can generate the graph an it appears acceptable then work on the color.

You may want to investigate Robert Allison's SAS/Graph Examples! for a large selection of graphs with associated code and data.

Super Contributor
Super Contributor
Posts: 318

Re: proc gchart

i got graph generated using below code

proc gchar data=xyz;

vbar3d wk_2015 / sumvar=percent_run_fine

                                 subgroup=improve

                                 outside=sum

                                 width=5;

run;

quit;

have two question:

1) i want to generate number in percentage - what could be the format for var "percent_run_fine" and "improve" (improve variable is number like 12.50)

2) i want to send graph (e-html) out through email attachment to team using link - how can i do this?

Thank you!

Grand Advisor
Posts: 17,396

Re: proc gchart

1. Apply format to variable, percent8.2 for example

2. Search for example code on here or lexjansen.com, there's a lot of examples.

Ask a Question
Discussion stats
  • 5 replies
  • 351 views
  • 0 likes
  • 3 in conversation