<?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: keylegend or discrete legend not orientating correctly. ODS settings? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488999#M16821</link>
    <description>&lt;P&gt;Data is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried with HTMLBLUE, although I gave almost no knowledge of the options in ODS graphics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output looked the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT color="#0000FF"&gt; NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;/FONT&gt;
 73         
 74         
 75         ods listing close;
 76         ods html style=htmlblue;
&lt;FONT color="#0000FF"&gt; NOTE: Writing HTML Body file: sashtml10.htm&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt; ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml10.htm.
 ERROR: No body file. HTML output will not be created.&lt;/FONT&gt;
 77         
 78         proc sgplot data=glm_MAP2 nowall noborder  ;
 79         
 80         title 'Linear Regression Models with Parameter estimates and SD for MAP';
 81             styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;
 82         
 83         refline "mean Nex" "mean LA" "mean UA" "mean LL"/
 84         discretethickness=1
 85         lineattrs=(color=pink)
 86         axis=y;
 87         
 88         hbarparm category=IV  response= Param /
 89         group =DV
 90         groupdisplay =cluster
 91         grouporder=data
 92         barwidth=0.4
 93         clusterwidth=1
 94         limitupper=SD_Param;
 95         
 96         yaxis type=discrete discreteorder=data label ="." ;
 97         xaxis label =".";
 98         discretelegend   /across=7  location=outside   noborder  ;
 99         yaxistable N rpIII  rParam rLCL rUCL/
 100        VALUEATTRS=(Color=Black Family=Arial Size=7  Weight=Normal )
 101        VALUEHALIGN=CENTER
 102        VALUEJUSTIFY= CENTER ;
 103         run;
 
&lt;FONT color="#0000FF"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           1.53 seconds
       cpu time            0.28 seconds&lt;/FONT&gt;
       
&lt;FONT color="#339966"&gt; WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.&lt;/FONT&gt;
 NOTE: Some of the tick values have been thinned.
&lt;FONT color="#339966"&gt; WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.&lt;/FONT&gt;
 &lt;FONT color="#0000FF"&gt;NOTE: There were 28 observations read from the data set USER.GLM_MAP2.&lt;/FONT&gt;
 
 104        
 105        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Aug 2018 18:31:15 GMT</pubDate>
    <dc:creator>ChristosK</dc:creator>
    <dc:date>2018-08-22T18:31:15Z</dc:date>
    <item>
      <title>keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488977#M16819</link>
      <description>&lt;P&gt;I've put this &amp;nbsp;figure together using this code but in the results windows, the keylegend displays the correct values but only as a column. Have tried running different across and down statements such as across =7 and down =1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So tried instead&amp;nbsp;the discrete legend.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=600 height=800  maxlegendarea=45 ;
   
   proc sgplot data=glm_MAP2 nowall noborder  ;

      title 'Linear Regression Models with Parameter estimates and SD for MAP';
      styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;

refline "mean Nex" "mean LA" "mean UA" "mean LL"/ discretethickness=1 lineattrs=(color=pink) axis=y;
hbarparm category=IV  response= Param / group =DV groupdisplay =cluster  grouporder=data 
barwidth=0.4  clusterwidth=1   limitupper=SD_Param    ;

yaxis type=discrete discreteorder=data label =".";
xaxis label ="."; 
discretelegend  / across=1 location=outside   noborder;  
yaxistable N rpIII  rParam rLCL 	rUCL/ VALUEATTRS=(Color=Black Family=Arial Size=7  Weight=Normal ) VALUEHALIGN=CENTER VALUEJUSTIFY= CENTER ;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error I get for down=1:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           0.38 seconds
       cpu time            0.20 seconds
       
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 NOTE: There were 28 observations read from the data set USER.GLM_MAP2.
 
 92         
 93  &lt;SPAN class="token procnames"&gt;OPTIONS&lt;/SPAN&gt; NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error for Across=7:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           0.42 seconds
       cpu time            0.20 seconds
       
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 NOTE: There were 28 observations read from the data set USER.GLM_MAP2.
 
 92         
 93         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Since I am using a yaxis table, there may be a limited area to place the keylegend or dioscretelegend, although it worked fine when during my initial attempts with these axes transposed , with an x axis table and &amp;nbsp;vertical bands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something I can do with the ODS settings to allow this to work?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 16:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488977#M16819</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-22T16:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488985#M16820</link>
      <description>&lt;P&gt;No data to test code against.&lt;/P&gt;
&lt;P&gt;Also use of a custom STYLE may be having an impact that we cannot evaluate without the STYLE. Does the same thing happen when using other SAS styles such as HTMLBLUE?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also consider formatting the code with slightly shorter lines before posting to the forum. Extremely long lines are very difficult to deal with as the horizontal scroll is very cumbersome. Layout helps identify which options go with&amp;nbsp;which statement as well.&amp;nbsp;Something such as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off 
               width=600 height=800  
               maxlegendarea=45 
;
   
proc sgplot data=glm_MAP2 nowall noborder  ;

   title 'Linear Regression Models with Parameter estimates and SD for MAP';
   styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;

   refline "mean Nex" "mean LA" "mean UA" "mean LL"/ 
            discretethickness=1 
            lineattrs=(color=pink) 
            axis=y
   ;
   hbarparm category=IV  response= Param / 
            group =DV 
            groupdisplay =cluster  
            grouporder=data 
            barwidth=0.4  
            clusterwidth=1   
            limitupper=SD_Param    
   ;

   yaxis type=discrete discreteorder=data label =".";
   xaxis label ="."; 
   discretelegend  / across=1 location=outside   noborder;  
   yaxistable N rpIII  rParam rLCL 	rUCL/ 
      VALUEATTRS=(Color=Black Family=Arial Size=7  Weight=Normal ) 
      VALUEHALIGN=CENTER 
      VALUEJUSTIFY= CENTER
   ;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 17:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488985#M16820</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-22T17:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488999#M16821</link>
      <description>&lt;P&gt;Data is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried with HTMLBLUE, although I gave almost no knowledge of the options in ODS graphics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output looked the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT color="#0000FF"&gt; NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;/FONT&gt;
 73         
 74         
 75         ods listing close;
 76         ods html style=htmlblue;
&lt;FONT color="#0000FF"&gt; NOTE: Writing HTML Body file: sashtml10.htm&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt; ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml10.htm.
 ERROR: No body file. HTML output will not be created.&lt;/FONT&gt;
 77         
 78         proc sgplot data=glm_MAP2 nowall noborder  ;
 79         
 80         title 'Linear Regression Models with Parameter estimates and SD for MAP';
 81             styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;
 82         
 83         refline "mean Nex" "mean LA" "mean UA" "mean LL"/
 84         discretethickness=1
 85         lineattrs=(color=pink)
 86         axis=y;
 87         
 88         hbarparm category=IV  response= Param /
 89         group =DV
 90         groupdisplay =cluster
 91         grouporder=data
 92         barwidth=0.4
 93         clusterwidth=1
 94         limitupper=SD_Param;
 95         
 96         yaxis type=discrete discreteorder=data label ="." ;
 97         xaxis label =".";
 98         discretelegend   /across=7  location=outside   noborder  ;
 99         yaxistable N rpIII  rParam rLCL rUCL/
 100        VALUEATTRS=(Color=Black Family=Arial Size=7  Weight=Normal )
 101        VALUEHALIGN=CENTER
 102        VALUEJUSTIFY= CENTER ;
 103         run;
 
&lt;FONT color="#0000FF"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           1.53 seconds
       cpu time            0.28 seconds&lt;/FONT&gt;
       
&lt;FONT color="#339966"&gt; WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.&lt;/FONT&gt;
 NOTE: Some of the tick values have been thinned.
&lt;FONT color="#339966"&gt; WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.&lt;/FONT&gt;
 &lt;FONT color="#0000FF"&gt;NOTE: There were 28 observations read from the data set USER.GLM_MAP2.&lt;/FONT&gt;
 
 104        
 105        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Aug 2018 18:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/488999#M16821</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-22T18:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489001#M16822</link>
      <description>&lt;P&gt;Here is the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried HTMLBLUE, although &amp;nbsp;I have almost no knowledge of the options in ODS Graophics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seemed to make no difference. Here is the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
&lt;FONT color="#0000FF"&gt; NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;/FONT&gt;
 73         
 74         
 75         ods listing close;
 76         ods html style=htmlblue;
&lt;FONT color="#0000FF"&gt; NOTE: Writing HTML Body file: sashtml10.htm&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt; ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml10.htm.
 ERROR: No body file. HTML output will not be created.&lt;/FONT&gt;
 77         
 78         proc sgplot data=glm_MAP2 nowall noborder  ;
 79         
 80         title 'Linear Regression Models with Parameter estimates and SD for MAP';
 81             styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;
 82         
 83         refline "mean Nex" "mean LA" "mean UA" "mean LL"/
 84         discretethickness=1
 85         lineattrs=(color=pink)
 86         axis=y;
 87         
 88         hbarparm category=IV  response= Param /
 89         group =DV
 90         groupdisplay =cluster
 91         grouporder=data
 92         barwidth=0.4
 93         clusterwidth=1
 94         limitupper=SD_Param;
 95         
 96         yaxis type=discrete discreteorder=data label ="." ;
 97         xaxis label =".";
 98         discretelegend   /across=7  location=outside   noborder  ;
 99         yaxistable N rpIII  rParam rLCL rUCL/
 100        VALUEATTRS=(Color=Black Family=Arial Size=7  Weight=Normal )
 101        VALUEHALIGN=CENTER
 102        VALUEJUSTIFY= CENTER ;
 103         run;
 
&lt;FONT color="#0000FF"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           1.53 seconds
       cpu time            0.28 seconds&lt;/FONT&gt;
       
&lt;FONT color="#339966"&gt; WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.&lt;/FONT&gt;
 &lt;FONT color="#0000FF"&gt;NOTE: Some of the tick values have been thinned.&lt;/FONT&gt;
&lt;FONT color="#339966"&gt; WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt; NOTE: There were 28 observations read from the data set USER.GLM_MAP2.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Aug 2018 18:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489001#M16822</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-22T18:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489615#M16836</link>
      <description>&lt;P&gt;I used the TMPLOUT option in SGPLOT to get the template code for your graph, then moved the legend into the SIDEBAR block to allow it full range of the bottom of the graph.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In GTL you can change the DISPLAYCLIPPED to be true so that the legend prints even if it is clipped.&amp;nbsp; However it was too wide with only one row so not all values were getting shown.&amp;nbsp; I instead changed DOWN=2 and it prints pretty nice.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
    ods path WORK.TEMPLAT(UPDATE) SASHELP.TMPLMST (READ);
proc template;
define statgraph sgplot;
dynamic _NEGATIVE_;
dynamic _ticklist_;
begingraph / collation=binary dataContrastColors=( CX016381 CX1BC9FF CXFF7F00 CX814101 );
EntryTitle "Linear Regression Models with Parameter estimates and SD for MAP" /;
layout lattice / columnweights=preferred rowweights=preferred columndatarange=union rowdatarange=union columns=6;
    sidebar / align=bottom;
            DiscreteLegend "HBARPARM" / Location=Outside down=2 order=columnMajor Title="DV" Border=false displayclipped=true;
    endsidebar;
   layout overlay / walldisplay=none xaxisopts=( Label="." type=linear ) yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) y2axisopts=(type=Discrete reverse=true discreteOpts=(tickValueList=_ticklist_ tickValueListPolicy=Union));
      ReferenceLine y= "mean Nex" / clip=true useDiscreteThickness=true discreteLineThickness=1 Lineattrs=( Color=CXFFC0CB);
      ReferenceLine y= "mean LA" / clip=true useDiscreteThickness=true discreteLineThickness=1 Lineattrs=( Color=CXFFC0CB);
      ReferenceLine y= "mean UA" / clip=true useDiscreteThickness=true discreteLineThickness=1 Lineattrs=( Color=CXFFC0CB);
      ReferenceLine y= "mean LL" / clip=true useDiscreteThickness=true discreteLineThickness=1 Lineattrs=( Color=CXFFC0CB);
      BarChartParm X=IV Y=Param / ErrorUpper=SD_Param primary=true orient=horizontal Group=DV barwidth=0.4 LegendLabel="Param" NAME="HBARPARM" groupdisplay=cluster grouporder=data clusterwidth=1;
  endlayout;
    Layout Overlay /  yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) walldisplay=none yaxisopts=(display=none griddisplay=off displaySecondary=none) y2axisopts=(display=none griddisplay=off displaySecondary=none);
    AxisTable Value=N Y=IV / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay /  yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) walldisplay=none yaxisopts=(display=none griddisplay=off displaySecondary=none) y2axisopts=(display=none griddisplay=off displaySecondary=none);
 AxisTable Value=rpIII Y=IV / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay /  yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) walldisplay=none yaxisopts=(display=none griddisplay=off displaySecondary=none) y2axisopts=(display=none griddisplay=off displaySecondary=none);
 AxisTable Value=rParam Y=IV / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay /  yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) walldisplay=none yaxisopts=(display=none griddisplay=off displaySecondary=none) y2axisopts=(display=none griddisplay=off displaySecondary=none);
 AxisTable Value=rLCL Y=IV / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay /  yaxisopts=( reverse=true Label="." type=discrete discreteopts=( sortOrder=data ) ) walldisplay=none yaxisopts=(display=none griddisplay=off displaySecondary=none) y2axisopts=(display=none griddisplay=off displaySecondary=none);
 AxisTable Value=rUCL Y=IV / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=ibm.glm_map2 template=sgplot;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGRender.png" style="width: 450px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22752i86568C6D02578D96/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender.png" alt="SGRender.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489615#M16836</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-24T14:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489663#M16840</link>
      <description>&lt;P&gt;Jeff:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for that solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only other things that would be use full would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Creating spaces between selected rows&lt;/P&gt;&lt;P&gt;2) Colour coding selected blocks (like the first 4 blue ones could have a background colour thats other than white.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lots of new code options here that I have never seen before. Is there a source somewhere that explains these?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489663#M16840</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-24T16:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489727#M16843</link>
      <description>&lt;P&gt;Here is the reference for GTL in the newest SAS version:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl//en/grstatgraph/69718/HTML/default/viewer.htm#titlepage.htm" target="_self"&gt;http://support.sas.com/documentation/cdl//en/grstatgraph/69718/HTML/default/viewer.htm#titlepage.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can always output your SGPLOT to GTL with the TMPLOUT option to see what the background GTL code is.&amp;nbsp; It adds a lot of extraneous code, but isn't terrible.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to find solutions to your other two issues.&amp;nbsp; The code isn't as clean as I would like, but it potentially works.&amp;nbsp; The only way I could find to shade the backgrounds separately were to either use annotation (which is what I did) or to split each set of bars into it's own row and then color the backgrounds that way (more work potentially).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had to change your axis to be linear and made a numeric Y variable.&amp;nbsp; I then spaced out bars by adding a blank row at a specific y value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  
ods path WORK.TEMPLAT(UPDATE) SASHELP.TMPLMST (READ);
libname ibm '~/ibm/';
proc template;
define statgraph sgplot;
dynamic _NEGATIVE_;
dynamic _ticklist_;
begingraph / collation=binary dataContrastColors=( CX016381 CX1BC9FF CXFF7F00 CX814101 );
EntryTitle "Linear Regression Models with Parameter estimates and SD for MAP" /;
layout lattice / columnweights=preferred rowweights=preferred columndatarange=union rowdatarange=union columngutter=0 columns=7;
   
    sidebar / align=bottom;
            DiscreteLegend "HBARPARM" / Location=Outside down=2 order=columnMajor Title="DV" Border=false displayclipped=true;
    endsidebar;
    Layout Overlay /walldisplay=none yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
    AxisTable Value=iv Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center 
    Display=(values);
 endlayout;
   layout overlay / walldisplay=none xaxisopts=( display=(ticks tickvalues line) type=linear offsetmin=0 offsetmax=0) 
     yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=(line));
      annotate / id="poly";
      BarChartParm X=y Y=Param / ErrorUpper=SD_Param primary=true orient=horizontal Group=DV barwidth=0.4 LegendLabel="Param" NAME="HBARPARM" groupdisplay=cluster grouporder=data clusterwidth=1;
  endlayout;
    Layout Overlay / walldisplay=none  yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
    
      AxisTable Value=N Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay / walldisplay=none yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
      AxisTable Value=rpIII Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay / walldisplay=none yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
      AxisTable Value=rParam Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;

 Layout Overlay / walldisplay=none yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
      AxisTable Value=rLCL Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
 Layout Overlay / walldisplay=none yaxisopts=(reverse=true Label="." type=linear linearopts=(viewmin=0.5 viewmax=35) display=none);
      annotate / id="poly";
      AxisTable Value=rUCL Y=y / labelPosition=min ValueAttrs=( Color=CX000000 Size=7 Family="ARIAL" Weight=normal ) ValueHalign=Center ValueJustify=Center Display=(Label);
 endlayout;
endlayout;
endgraph;
end;
run;


data plot anno (keep=dv iv y);
    set ibm.glm_map2;
    by notsorted dv;
    y+1;
    if first.dv then do;
        output anno;
    end;
    if last.dv then do;
        output anno plot;
        y=y+1;
        call missing(iv, rpIII,of param--sd_param,measure);
        output plot;
    end;
    else output plot;
run;
data annotate;
    set anno;
    by notsorted dv;
    array colors {10} $20. ('blue','red','green','purple','grey','tan','orange','silver','brown','darkred');
    length id function x1space y1space $50.;
    if first.dv then do;
        _count_+1;
        id='poly';fillcolor=colors(_count_);display='fill';layer='background';transparency=0.8;
        function='polygon';
        x1=0;y1=y-0.75;x1space='LAYOUTPERCENT';y1space='DATAVALUE';output;
        function='polycont';
        x1=100;output;
    end;
    else do;
        id='poly';fillcolor=colors(_count_);display='fill';layer='background';transparency=0.8;
        function='polycont';
        x1=100;y1=y+0.75;x1space='LAYOUTPERCENT';y1space='DATAVALUE';output;
        function='polycont';
        x1=0;output;
    end;
    drop dv iv;
run;
        
   ods graphics / reset height=8in;
proc sgrender data=plot template=sgplot sganno=annotate;
run;&lt;/CODE&gt;&lt;/PRE&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="SGRender.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22761i9125BE3ADCC6DC1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender.png" alt="SGRender.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 18:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489727#M16843</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-24T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489777#M16844</link>
      <description>&lt;P&gt;Second version works perfectly.&lt;/P&gt;&lt;P&gt;Have am error message on first one:&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; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.\&lt;/CODE&gt;&lt;/PRE&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; 110        end;
 NOTE: Overwriting existing template/link: SGPlot
 NOTE: STATGRAPH 'SGPlot' has been saved to: WORK.TEMPLAT
 111        run;
 NOTE: PROCEDURE TEMPLATE used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 112        proc sgrender data=Schumann.glm_MAP2; template=sgplot;
                                                  ________
                                                  180
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 113        run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE SGRENDER used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 114        
 115        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 128        &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great stuff though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christos&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 21:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489777#M16844</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-24T21:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489780#M16845</link>
      <description>For the error delete the semicolon between the data= and the template=.  They both need to be apart of the PROC SGRENDER statement.</description>
      <pubDate>Fri, 24 Aug 2018 21:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489780#M16845</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-24T21:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: keylegend or discrete legend not orientating correctly. ODS settings?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489782#M16846</link>
      <description>&lt;P&gt;That works, thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 21:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/keylegend-or-discrete-legend-not-orientating-correctly-ODS/m-p/489782#M16846</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-08-24T21:55:59Z</dc:date>
    </item>
  </channel>
</rss>

