BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VCM
Obsidian | Level 7 VCM
Obsidian | Level 7

I am creating a waterfall plot where I need to add a hash symbol to then end of any bar where VAR1 has a certain value.  I've created variable ZZ with value = "#" when VAR1 meets the condition (if VAR1 = 1, then ZZ = "#").

 

Now, how do I add this in the proc template?  I tried markersymbol, but it puts the symbol on the zero (beginning of the bar), not at the end:

 

proc template;
define statgraph &repbase.;
begingraph;
entrytitle "(Number of Subjects = &num)"/TEXTATTRS=(weight=bold size=10pt);
layout overlay/xaxisopts=(label="Subjects" labelattrs=(weight=bold size=8pt)
griddisplay=on tickvalueattrs=(weight=bold size=7pt) type=discrete
display=(&x_axis_display))
yaxisopts=(label="&YAXIS_LABEL" labelattrs=(weight=bold size=8pt)
griddisplay=on
tickvalueattrs=(weight=bold size=8pt)
linearopts=(&y_axis_scale )
griddisplay=on);
barchart x=usubjid y=min/ group=TRT01AN name="trt" barwidth=0.4;
scatterplot x=usubjid y=label2/MARKERCHARACTER=zz MARKERCHARACTERATTRS=(weight=bold size=6pt);
referenceline y=-30 /lineattrs=(thickness=1px pattern=34 color=cx000000 ) CURVELABELATTRS=(weight=bold size=8pt);
referenceline y=20/lineattrs=(thickness=1px pattern=34 color=cx000000 ) CURVELABELATTRS=(weight=bold size=8pt);

discretelegend "trt"/title="Treatment Group:"  titleattrs=(weight=bold size=10pt) valueattrs=(weight=bold size=10pt);
endlayout;
endgraph;
end;
run;

 

proc sgrender data=tmm_plot template=&repbase.;
run;

 

 

Note that I am using SAS 9.2.  Is there an option I can use?

 

 

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

With SAS 9.2, you can overlay a SCATTERPLOT statement on the BARCHART statement using GTL as you have done.  Maybe the value of the "label2" variable is not correctly computed.  I did the something similar in this article to place the asterix on some bars using SGPLOT.  http://blogs.sas.com/content/graphicallyspeaking/2017/07/30/clinical-graphs-waterfall-plot/

 

View solution in original post

4 REPLIES 4
VCM
Obsidian | Level 7 VCM
Obsidian | Level 7

Hi Reeza--

 

Unfortunately, I'm running in a client's system, and I'm pretty much stuck with 9.2. 😞  But thanks for replying! 🙂

Jay54
Meteorite | Level 14

With SAS 9.2, you can overlay a SCATTERPLOT statement on the BARCHART statement using GTL as you have done.  Maybe the value of the "label2" variable is not correctly computed.  I did the something similar in this article to place the asterix on some bars using SGPLOT.  http://blogs.sas.com/content/graphicallyspeaking/2017/07/30/clinical-graphs-waterfall-plot/

 

VCM
Obsidian | Level 7 VCM
Obsidian | Level 7

Thank you, Sanjay, that was exactly it!  I updated the label2 value (defined in the body of the program) as min + 4 (for positive values) or min - 4 (for negative values), to allow a little bit of space between the edge of the bar and the symbol.

 

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1341 views
  • 1 like
  • 3 in conversation