<?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: Using SGPANEL, how can I highlight specific panels? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928231#M24628</link>
    <description>&lt;P&gt;Quentin, A more sophisticated way is using built-in %SGANNO macro .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input panelid x y ;
  cards ;
1 10 10
1 20 20
2 10 15
2 20 15
3 10 20
3 20 10
;

%sganno;

data sganno;
 %SGRECTANGLE(
     X1=53,
     Y1=53,
     HEIGHT=42,
     WIDTH=45,
     ANCHOR="BOTTOMLEFT" ,
     DISPLAY="FILL",
     DRAWSPACE="GRAPHPERCENT" ,
     FILLCOLOR="yellow" ,
     LAYER="BACK"
     )
run;

proc sgpanel data=have sganno=sganno ;
  panelby panelid/ layout=panel nowall;
  series x=x y=y;
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-1715658356461.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96500i48D2F86DDD385EED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1715658356461.png" alt="Ksharp_0-1715658356461.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2024 03:46:05 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-05-14T03:46:05Z</dc:date>
    <item>
      <title>Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928156#M24624</link>
      <description>&lt;P&gt;I'm using SGPANEL, and would like to highlight certain panels that are interesting.&amp;nbsp; I think I just want a way to set the wallcolor for each panel dynamically, is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code will make 3 panels, and all three will have the wallcolor set to yellow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input panelid x y ;
  cards ;
1 10 10
1 20 20
2 10 15
2 20 15
3 10 20
3 20 10
;

proc sgpanel data=have ;
  panelby panelid/ layout=panel;
  styleattrs wallcolor="yellow" ;
  series x=x y=y;
run ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there a way I can make only the second panel have a yellow wallcolor?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using a band plot in the background, which came close, but still extended the y-axis even though I set option NOEXTEND.&amp;nbsp; I'm sure I could try other methods for adding a yellow bar in the background of second panel (e.g. REFLINE instead of a BAND), but before I go down that path, wondered if I'm missing an easier way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My band plot approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have ;
  if panelid=2 then do ;
    lowerband=0 ;
    upperband=100 ;
  end ;
run ;

proc sgpanel data=want ;
  panelby panelid/ layout=panel;
  band x=x lower=lowerband upper=upperband /fillattrs=(color=yellow) noextend;
  series x=x y=y;
run ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Returned:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1715615469961.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96485i23CB3D5DAE9014F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1715615469961.png" alt="Quentin_0-1715615469961.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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 15:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928156#M24624</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-13T15:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928228#M24627</link>
      <description>&lt;P&gt;Quentin,&lt;/P&gt;
&lt;P&gt;You could use options "offsetmin=0 offsetmax=0" to eliminate these cell padding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=want ;
  panelby panelid/ layout=panel;
  band x=x lower=lowerband upper=upperband /fillattrs=(color=yellow) noextend;
  series x=x y=y;
  colaxis offsetmin=0 offsetmax=0;
  rowaxis offsetmin=0 offsetmax=0;
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-1715657511473.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96499i44077D9BFF50E03A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1715657511473.png" alt="Ksharp_0-1715657511473.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 03:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928228#M24627</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-14T03:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928231#M24628</link>
      <description>&lt;P&gt;Quentin, A more sophisticated way is using built-in %SGANNO macro .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input panelid x y ;
  cards ;
1 10 10
1 20 20
2 10 15
2 20 15
3 10 20
3 20 10
;

%sganno;

data sganno;
 %SGRECTANGLE(
     X1=53,
     Y1=53,
     HEIGHT=42,
     WIDTH=45,
     ANCHOR="BOTTOMLEFT" ,
     DISPLAY="FILL",
     DRAWSPACE="GRAPHPERCENT" ,
     FILLCOLOR="yellow" ,
     LAYER="BACK"
     )
run;

proc sgpanel data=have sganno=sganno ;
  panelby panelid/ layout=panel nowall;
  series x=x y=y;
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-1715658356461.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96500i48D2F86DDD385EED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1715658356461.png" alt="Ksharp_0-1715658356461.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 03:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928231#M24628</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-14T03:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928249#M24629</link>
      <description>&lt;P&gt;How about using the BLOCK plot for the highlighting, like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want ;
  set have ;
  if panelid=2 then do ;
    block = "highlight";
  end ;
run ;

proc sgpanel data=want ;
  panelby panelid/ layout=panel;  
  block x=x block=block /
/*    novalues*/
    class=block nomissingclass
    fill  fillattrs=(color=cornsilk) FILLTYPE=alternate
  ;
  series x=x y=y;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunoMueller_0-1715677410949.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96504i3B6D897F295A8F30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunoMueller_0-1715677410949.png" alt="BrunoMueller_0-1715677410949.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would even allow you to say why its background is different. You can switch of the text using NOVALUES. The additional CLASS= and NOMISSINGCLASS makeit easy to only display it for the panel wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using an attribute map you even have more possibilities:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data attrmap;
  retain ID "myid";
  length value fillcolor  $ 16;
  input value  fillcolor filltransparency;
datalines;
highlight  gold 0
_OTHER_ lightgrey 1
;

proc sgpanel data=want dattrmap=attrmap ;
  panelby panelid/ layout=panel;  
  block x=x block=block /
    novalues
    attrid=myid
    filltype=multicolor
  ;
  series x=x y=y;
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 May 2024 09:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928249#M24629</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2024-05-14T09:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928251#M24630</link>
      <description>&lt;P&gt;Maybe with additional:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;valueattrs=(color=cornsilk)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to hide the "highlight" text? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 09:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928251#M24630</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-05-14T09:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928252#M24631</link>
      <description>You can use the NOVALUES to hide the text</description>
      <pubDate>Tue, 14 May 2024 09:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928252#M24631</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2024-05-14T09:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928369#M24635</link>
      <description>&lt;P&gt;Thanks so much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Really appreciate you adding the attrmap example, it's exactly what I need in order to keep the highlighting consistent.&amp;nbsp; The block chart is working perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I started with ODS graphics I started with GTL.&amp;nbsp; But about a year later I realized how much customization you could do with SGPLOT and SGPANEL, and it always amazes me how flexible they are.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 19:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928369#M24635</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-14T19:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using SGPANEL, how can I highlight specific panels?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928447#M24636</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;you are welcome. I went through the same process, needed many times GTL, but then SGPLOT got more and more features and it got a lot easier to do special stuff.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 08:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-SGPANEL-how-can-I-highlight-specific-panels/m-p/928447#M24636</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2024-05-15T08:15:24Z</dc:date>
    </item>
  </channel>
</rss>

