Data visualization with SAS programming

Is there is any way to get rid of Final bar in Waterfall chart

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 99
Accepted Solution

Is there is any way to get rid of Final bar in Waterfall chart

HI Sas Experts,

 

I wanted to remove the final bar from the waterfall chart. Please guide

Please check  the attched image.

Attachment

Accepted Solutions
Solution
‎09-22-2016 10:49 AM
SAS Super FREQ
Posts: 620

Re: Is there is any way to get rid of Final bar in Waterfall chart

[ Edited ]

Yes there is.

 

You will need to use GTL to do this.

 

For a start you can use your Proc SGPLOT code and add the TMPLOUT= option. This will write out the GTL code to a file.

 

proc sgplot data=sashelp.class tmplout="c:\temp\sgplot.sas";
  waterfall category=age response=height ;
run;

Then adapt the code like below. Check the doc for the WATERFALLCHART statement it has the DISPLAY= option.

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define statgraph sgplot_waterfall;
    begingraph / collation=binary;
      layout overlay / yaxisopts=(labelFitPolicy=Split) y2axisopts=(labelFitPolicy=Split);
        WaterfallChart Category=Age Response=Height / 
          primary=true LegendLabel="Height" NAME="WATERFALL"
          display=(
          FILL 
          /*            FINALBAR displays the “final” bar */
          OUTLINE 
          CONNECT 
          )
        ;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.class template=sgplot_waterfall;
run;

Bruno

View solution in original post


All Replies
Solution
‎09-22-2016 10:49 AM
SAS Super FREQ
Posts: 620

Re: Is there is any way to get rid of Final bar in Waterfall chart

[ Edited ]

Yes there is.

 

You will need to use GTL to do this.

 

For a start you can use your Proc SGPLOT code and add the TMPLOUT= option. This will write out the GTL code to a file.

 

proc sgplot data=sashelp.class tmplout="c:\temp\sgplot.sas";
  waterfall category=age response=height ;
run;

Then adapt the code like below. Check the doc for the WATERFALLCHART statement it has the DISPLAY= option.

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define statgraph sgplot_waterfall;
    begingraph / collation=binary;
      layout overlay / yaxisopts=(labelFitPolicy=Split) y2axisopts=(labelFitPolicy=Split);
        WaterfallChart Category=Age Response=Height / 
          primary=true LegendLabel="Height" NAME="WATERFALL"
          display=(
          FILL 
          /*            FINALBAR displays the “final” bar */
          OUTLINE 
          CONNECT 
          )
        ;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.class template=sgplot_waterfall;
run;

Bruno

Frequent Contributor
Posts: 99

Re: Is there is any way to get rid of Final bar in Waterfall chart

Hi Bruno,

 

Thats working fine, can i also get the values on the top of the each bar.(and I also want to get the space between each bar is there is anyway to do this). 

 

Thank you very much.

SAS Super FREQ
Posts: 620

Re: Is there is any way to get rid of Final bar in Waterfall chart

Hi

 

Have a look at the doc for the WATERFALL statement, data values can usally be displayed with the DATALABEL option.

 

Bruno

Post a Question
Discussion Stats
  • 3 replies
  • 294 views
  • 2 likes
  • 2 in conversation