BookmarkSubscribeRSS Feed
sanjay1
Obsidian | Level 7

Hi SAS Experts,

 

I want to get rid of the Final bar in waterfall chart is there is any way to do this, below is my code.

 

data a;
input name$ marks;
datalines;
scott 99
maria 88
michel 40
john 101
;
run;

 

proc sgplot data=a;
waterfall category=name response=marks/colorgroup=name datalabel dataskin=none finalbarattrs=(color=CXF6B333);
/* keylegend / location=outside down=3 opaque;*/
xaxis display=(nolabel) discreteorder=data;
yaxis offsetmin=0 ;
run;

 

Please guide

3 REPLIES 3
ballardw
Super User

A quickish and dirty way would be to add a REFLINE that is opaque and the color of the background color of the plot area that coinsides with that location.

Jay54
Meteorite | Level 14

For simple cases, you could compute the sequential values yourself and use HighLow plot.  This will give you full control.

DanH_sas
SAS Super FREQ

There is an option in GTL waterfall chart to turn off the final bar; but, unfortunately, we do not currently have it in SGPLOT. However, you can use the TMPLOUT option on the SGPLOT procedure statement to dump out the GTL template. Then, on the WATERFALLCHART statement after the "/", add this option:

 

display=(fill outline connect)

 

Run this template with PROC SGRENDER. This should give you your current appearance, minus the final bar.

 

Hope this helps!

Dan

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