Data visualization with SAS programming

How to create a stacked waterfall chart

Reply
Occasional Contributor
Posts: 7

How to create a stacked waterfall chart

I would like to know how I can create a stacked waterfall chart using proc template (waterfallchart) and sgrender.  I can use another graphing procedure if it allows me to save the image as a file (I use this image for a website).  I have seen the other approaches (clear/white bar chart, also using annotate with gplot) but those seem to be workarounds before the waterfall chart option in 9.3.

My data consists of stages (aka categories, 4 of them) and types (2) of them.  Any suggestions?

For reference, here is the data as well as procedures.  The final output should look something like the picture attached (the values do not match the datasets below, ignore that).

  • Categories with stacked types
  • Labels for size of bars
  • Can save as image file for use elsewhere

Thanks.

DATA (ignore the differences in stage values, I merely changed the values even though the four possibilities remain the same)

stagetypevalue
Prev. OpenNon-Audit/Comp2
Prev. OpenAudit/Comp0
NewNon-Audit/Comp6
NewAudit/Comp15
CompletedAudit/Comp12
CompletedNon-Audit/Comp4
RemainingAudit/Comp3
RemainingNon-Audit/Comp4

DATA USED IN PROC TEMPLATE

stageNY
outstanding_prj20
new_prj615
completed_prj412
remaining_prj43

PROC TEMPLATE

%let opts = linearopts=(viewmin=0 viewmax=&max_hght tickvaluesequence=(start=0 end=&max_hght increment=5));* tickvaluelist=(-0.1 0 0.1)) offsetmin=0.1 offsetmax=0.1;

proc template;

  define statgraph waterfallchart;

    begingraph;

      layout overlay / yaxisopts=(&opts);

        waterfallchart category=stage response=total /

          colorgroup=type barlabel=true

   display=(fill)

          name="Project Throughput" dataskin=gloss;* filltype=gradient;

      endlayout;

    endgraph;

  end;

run;

ODS Rendering

ods html path="&base_rpt" (url=none);

ods graphics / width=300px reset=index imagename="DP_water_&dt._" ;

proc sgrender data=wf_dp template=waterfallchart;

run;


stacked waterfall.jpg
Respected Advisor
Posts: 3,156

Re: How to create a stacked waterfall chart

Bump! I feel the OP, tired of "clear/white bar", wanting to know if there are other ways.

Ask a Question
Discussion stats
  • 1 reply
  • 710 views
  • 0 likes
  • 2 in conversation