turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS/GRAPH and ODS Graphics
- /
- Adding symbol at the end of bars in a waterfall pl...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-08-2017 05:43 PM

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!

Accepted Solutions

Solution

09-11-2017
07:18 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-08-2017 10:51 PM

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-08-2017 05:49 PM

If you're using SAS 9.4 maybe DATALABEL options instead?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

09-11-2017 08:19 AM

Hi Reeza--

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

Solution

09-11-2017
07:18 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-08-2017 10:51 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sanjay_SAS

09-11-2017 07:22 AM

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.