<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add arrow in the waterfall plot as shown in the question. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919394#M24434</link>
    <description>1) You could use the following option of PROC SGPLOT  to make uniform scale of Y axis for different page.&lt;BR /&gt;UNIFORM=GROUP | SCALE | ALL | XSCALE | YSCALE | XSCALEGROUP | YSCALEGROUP&lt;BR /&gt;specifies how to control axis scaling and legends when you use a BY statement.&lt;BR /&gt;2)You could also specify BASELINE=0 option of VBAR to force it be zero ,then you don't need to consider of shift/offset.&lt;BR /&gt;&lt;BR /&gt;3) Alternative way is to make a macro, specify a macro parameter to represent this baseline value ,and a visit for a macro ,ne need BY statement.</description>
    <pubDate>Fri, 08 Mar 2024 02:06:55 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-03-08T02:06:55Z</dc:date>
    <item>
      <title>How to add arrow in the waterfall plot as shown in the question.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919373#M24432</link>
      <description>&lt;P&gt;Hi, I would like to add arrows to show "improved/worsened" in the waterfall plot output like the screenshot below.&amp;nbsp; The separation point of the red/green arrows is based on the y-axis line 0.0. I can use annotation to get it shown from PROC SGPLOT on the first page (the SAS code is provided). However, because the program will generate multiple pages, each page represents a different item with different y-axis range.&amp;nbsp; The position of 0.0 line on each page will change/shift, therefore a fixed position of the arrows (from the annotation below) won't work. Would you please provide some suggestions/solutions on this issue to help me get this resolved?&amp;nbsp; Many thanks. (or is there a way to display these red/green arrows inside the plot and does not mess up the plot itself?)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chiaholee_0-1709842261137.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94468i4208DE51529BE133/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chiaholee_0-1709842261137.png" alt="chiaholee_0-1709842261137.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;data anno1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;length textcolor $40;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;drawspace ="GRAPHPERCENT";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;function="text";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;ANCHOR= "TOP";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;rotate=90;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;label = 'Worsened';&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;x1=98; y1=70;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;textcolor ="RED";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;output;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;x1=98; y1=88;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;label = 'Improved';&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;textcolor ="GREEN";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;output;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;data anno2;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;drawspace ="GRAPHPERCENT";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;function ='ARROW';&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;SHAPE='FILLED';&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;direction='IN';&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;linethickness = 6;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;widthunit ="pixel";&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;linecolor = "red";&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;x1=97; x2=97;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;y1=62; y2=78; output;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;linecolor = "lightgreen";&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;y1=98; y2=82; output;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;data anno;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;length function $20;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;set anno1 anno2;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%do k = 1 %to %sysfunc(countw(&amp;amp;Al,|));&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%do i = 1 %to %sysfunc(countw(&amp;amp;Bl,|));&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%do j = 1 %to %sysfunc(countw(&amp;amp;Cl,|));&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;data ingraph;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set gdata;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if A="%qscan(%superq(Al),&amp;amp;k,|)" and B=%qscan(%superq(Bl),&amp;amp;i,|) and&amp;nbsp; C=%qscan(%superq(Cl),&amp;amp;j,|);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;proc sgplot data=ingraph dattrmap=attribap &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;sganno=anno&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;noautolegend;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;by visit;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;vbar Position / group=xxx attrid=ID1 response=yyy barwidth=0.3;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;refline 0 / axis=y lineattrs=(pattern=shortdash);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;xaxis label="ID" VALUESROTATE=VERTICAL fitpolicy=rotate;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;yaxis label="Change for &amp;amp;B" offsetmax=0.025 offsetmin=.025 values=(&amp;amp;miny. to &amp;amp;maxy. by &amp;amp;inc.);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;legenditem type=markerline name='item1' / lineattrs=(pattern=Solid color=CX0085B2)&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; markerattrs=(symbol=squarefilled color=CX0085B2);&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;legenditem type=markerline name='item2' / lineattrs=(pattern=Solid color=CX808080)&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;markerattrs=(symbol=squarefilled color=CX808080);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;keylegend 'item1' 'item2' / noborder;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 21:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919373#M24432</guid>
      <dc:creator>chiaholee</dc:creator>
      <dc:date>2024-03-07T21:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add arrow in the waterfall plot as shown in the question.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919382#M24433</link>
      <description>&lt;P&gt;Without actual data, or a much clearer description of how all your different graphs will vary, it is not going to be possible to provide code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this were my project I think I would investigate adding data to the plot data set(s) to create VECTOR plots for the arrows. Since this would move the arrows into the graph area you would need to set xaxis options to include your current range of values plus a bit to set the xorigin for the vectors. Your yorigin would be a small offset positive and negative from 0 and set the x, y coordinates for the pair for each plot to be in the range. Whether one vector with a Group option would work better than two vector plots hard to tell.&lt;/P&gt;
&lt;P&gt;A TEXT plot code provide the text to go with the vectors&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 23:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919382#M24433</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-07T23:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add arrow in the waterfall plot as shown in the question.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919394#M24434</link>
      <description>1) You could use the following option of PROC SGPLOT  to make uniform scale of Y axis for different page.&lt;BR /&gt;UNIFORM=GROUP | SCALE | ALL | XSCALE | YSCALE | XSCALEGROUP | YSCALEGROUP&lt;BR /&gt;specifies how to control axis scaling and legends when you use a BY statement.&lt;BR /&gt;2)You could also specify BASELINE=0 option of VBAR to force it be zero ,then you don't need to consider of shift/offset.&lt;BR /&gt;&lt;BR /&gt;3) Alternative way is to make a macro, specify a macro parameter to represent this baseline value ,and a visit for a macro ,ne need BY statement.</description>
      <pubDate>Fri, 08 Mar 2024 02:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919394#M24434</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-03-08T02:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add arrow in the waterfall plot as shown in the question.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919519#M24435</link>
      <description>&lt;P&gt;The key for doing what you requested is to use different drawing spaces. You should set the drawing space for the Y coordinate you want to zero to be Y1SPACE="DATAVALUE" and Y1=0. That way, the arrows will follow the zero tick on the Y-axis regardless of where it is drawn. The other coordinates can be drawn in other drawing spaces. For your use case, I would tend to set X1SPACE and X2SPACE to be WALLPERCENT, and set X1 and X1 to be values greater than 100. That way, the arrows are drawn outside of the wall at a consistent distance from the wall, regardless of graph size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 18:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-arrow-in-the-waterfall-plot-as-shown-in-the-question/m-p/919519#M24435</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-03-08T18:40:47Z</dc:date>
    </item>
  </channel>
</rss>

