<?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: Shade a portion of a VBARBASIC using BLOCK statement. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937485#M24852</link>
    <description>&lt;P&gt;Something like this should work for you:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=class;
  styleattrs DATACOLORS=(Black Gray);
  vbarbasic age / nooutline
      group = sex
      groupdisplay=cluster
      response=Weight
      stat=mean
      ;
  block x=age block=age2 / novalues fillattrs=(color=white) 
      altfillattrs=(color=cxAAAAAA) transparency=0.9 filltype=alternate;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Jul 2024 16:31:58 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2024-07-29T16:31:58Z</dc:date>
    <item>
      <title>Shade a portion of a VBARBASIC using BLOCK statement.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937478#M24851</link>
      <description>&lt;P&gt;In my VBAR chart I want to shade AGE=16 with a gray background.&amp;nbsp; I have that working (AGE2=16) but I'm not able to figure out how to get the other block, (AGE2=. everything else) to have white background.&amp;nbsp; I don't understand how to use ATTR parameters to get what I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
   set sashelp.class;
   if age eq 16 then age2=age;
   else age2=.;
   run;
proc sort;
   by age sex;
   run;
proc print;
   run;
ods output sgplot=sglot;
proc sgplot data=class;
  styleattrs DATACOLORS=(Black Gray);
  vbarbasic age / nooutline
      group = sex
      groupdisplay=cluster
      response=Weight
      stat=mean
      ;
  block x=age block=age2 / novalues transparency=.9; 
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the figure I have AGE=16 shaded as I would like.&amp;nbsp; I need to understand how get BLOCK AGE2=. not shaded or shaded with color=white.&lt;/P&gt;
&lt;P&gt;&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="Capture2.PNG" style="width: 280px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98787i97F42FEEACB96E43/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 656px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98788i5B345CBEDE2934C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 16:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937478#M24851</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-07-29T16:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Shade a portion of a VBARBASIC using BLOCK statement.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937485#M24852</link>
      <description>&lt;P&gt;Something like this should work for you:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=class;
  styleattrs DATACOLORS=(Black Gray);
  vbarbasic age / nooutline
      group = sex
      groupdisplay=cluster
      response=Weight
      stat=mean
      ;
  block x=age block=age2 / novalues fillattrs=(color=white) 
      altfillattrs=(color=cxAAAAAA) transparency=0.9 filltype=alternate;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2024 16:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937485#M24852</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-07-29T16:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Shade a portion of a VBARBASIC using BLOCK statement.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937486#M24853</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;I will try this.&amp;nbsp; I found another way using X=AGE2 BLOCK=AGE2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  block x=age2 block=age2 / 
      FILLATTRS=(color='GRAY')
   novalues transparency=.8;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 16:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937486#M24853</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-07-29T16:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Shade a portion of a VBARBASIC using BLOCK statement.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937487#M24854</link>
      <description>&lt;P&gt;I am not sure what you want for output. Can you point to an example somewhat like what you want?&lt;/P&gt;
&lt;P&gt;I suspect part of the issues may be the MISSING values for age2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if this with light green/ red backgrounds looks somewhat like you expect. If the "green" should be white then change it.&lt;/P&gt;
&lt;P&gt;I'm not really sure what color you want for the age 16, but I would specify that instead where I have red.&lt;/P&gt;
&lt;P&gt;You might also want the BLOCK before the VBARBASIC to avoid shading the bar colors.&lt;/P&gt;
&lt;PRE&gt;data class;
   set sashelp.class;
   if age eq 16 then age2='block2';
   else age2='block1';
   run;
proc sort;
   by age sex;
   run;
proc print;
   run;
ods output sgplot=sglot;
proc sgplot data=class;
  styleattrs DATACOLORS=(Black Gray);
  block x=age block=age2 / filltype=alternate fillattrs=(color=green) altfillattrs=(color=red) novalues transparency=.9; 

  vbarbasic age / nooutline
      group = sex
      groupdisplay=cluster
      response=Weight
      stat=mean
      ;  

run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2024 16:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937487#M24854</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-29T16:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Shade a portion of a VBARBASIC using BLOCK statement.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937488#M24855</link>
      <description>&lt;P&gt;Actually, your way is better, as "age2" contains only the one bar you want to highlight. That way, you don't have to deal with any interactions with the other bars.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 16:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Shade-a-portion-of-a-VBARBASIC-using-BLOCK-statement/m-p/937488#M24855</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-07-29T16:38:47Z</dc:date>
    </item>
  </channel>
</rss>

