<?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: WaterFall Chart Dummy legend display if no data in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978788#M25720</link>
    <description>&lt;P&gt;You can use a discrete attributes map to do it. You can use the map to control both the attributes for the plot , as well as whether the legend content is driven by the map instead of the data. This last behavior is controlled by the SHOW=ATTRMAP option in the map data. Here is a simple example of a map using the active style's attributes but using SHOW=ATTRMAP to have its content used for the legend. In your case, put all five possible responses in the map.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data attrmap;
    retain ID "myid" show "attrmap";
    length value $ 7 fillstyleelement $ 10 linestyleelement $ 10; 
    input value $ fillstyleelement $ linestyleelement $;
    cards;
    M       GraphData1 GraphData1
    F       GraphData2 GraphData2
    Unknown GraphData3 GraphData3
    ;
run;

proc sgplot data=sashelp.class dattrmap=attrmap;
    vbar age / response=weight group=sex groupdisplay=cluster stat=mean attrid=myid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="attrmap.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111275i95910DBF50F03754/image-size/large?v=v2&amp;amp;px=999" role="button" title="attrmap.png" alt="attrmap.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Nov 2025 07:13:13 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2025-11-13T07:13:13Z</dc:date>
    <item>
      <title>WaterFall Chart Dummy legend display if no data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978785#M25719</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to genrate the waterfall plot , but in data there is no all legend vlauee and only diaplay in legend what are in data.&lt;/P&gt;&lt;P&gt;But i need to display all values which are defined in proc format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is sample output :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raja777pharma_0-1763006059514.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111273i16DEA0E0ED30BC72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raja777pharma_0-1763006059514.png" alt="raja777pharma_0-1763006059514.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Code is&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ods listing close;
ods graphics on / border=off width=22.86cm height=9.5cm;

   proc sgplot data=final noborder noautolegend;
   by trt01a;
    format resp $rsf.;
    refline -50 / axis=y lineattrs=(pattern=shortdash);

	vbar subjid/response = pchg categoryorder=RESPDESC group=resp;

	xaxis label = "Patient Number" fitpolicy = ROTATE;
	yaxis label = "Maximum Percent Reduction from Baseline in SPD" min=&amp;amp;minp. max=&amp;amp;maxp. values=(-120 to 50 by 20);

   keylegend /title = 'IPCGS' location=inside position=topright;
run;

ods rtf close;
ods listing;
ods&amp;nbsp;graphics&amp;nbsp;off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My current output : add one more group that is "PD" progressive disease&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raja777pharma_1-1763006151002.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111274i50EF2B713D56997A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raja777pharma_1-1763006151002.png" alt="raja777pharma_1-1763006151002.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to display this water fall as per sample display&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 03:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978785#M25719</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2025-11-13T03:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: WaterFall Chart Dummy legend display if no data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978788#M25720</link>
      <description>&lt;P&gt;You can use a discrete attributes map to do it. You can use the map to control both the attributes for the plot , as well as whether the legend content is driven by the map instead of the data. This last behavior is controlled by the SHOW=ATTRMAP option in the map data. Here is a simple example of a map using the active style's attributes but using SHOW=ATTRMAP to have its content used for the legend. In your case, put all five possible responses in the map.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data attrmap;
    retain ID "myid" show "attrmap";
    length value $ 7 fillstyleelement $ 10 linestyleelement $ 10; 
    input value $ fillstyleelement $ linestyleelement $;
    cards;
    M       GraphData1 GraphData1
    F       GraphData2 GraphData2
    Unknown GraphData3 GraphData3
    ;
run;

proc sgplot data=sashelp.class dattrmap=attrmap;
    vbar age / response=weight group=sex groupdisplay=cluster stat=mean attrid=myid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="attrmap.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111275i95910DBF50F03754/image-size/large?v=v2&amp;amp;px=999" role="button" title="attrmap.png" alt="attrmap.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 07:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978788#M25720</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2025-11-13T07:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: WaterFall Chart Dummy legend display if no data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978793#M25723</link>
      <description>&lt;P&gt;Another workaround way is using LEGENDITEM statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data=sashelp.class;
    vbar age / response=weight group=sex groupdisplay=cluster stat=mean name='x';
	legenditem name='u' type=fill/fillattrs=(color=gray) label='Unknown';
	keylegend 'x' 'u';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1763020082051.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111277iC42E50D23FA24E61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1763020082051.png" alt="Ksharp_0-1763020082051.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 07:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/WaterFall-Chart-Dummy-legend-display-if-no-data/m-p/978793#M25723</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-13T07:48:16Z</dc:date>
    </item>
  </channel>
</rss>

