<?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: grouporder in proc template does not work in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315783#M11077</link>
    <description>&lt;P&gt;Two points to make here. &amp;nbsp;With SAS 9.4, it is easier to use AXISTABLE to display the values at the bottom. &amp;nbsp;See &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/" target="_blank"&gt;article&lt;/A&gt;. &amp;nbsp;The stacking is done using CLASS variable, and you can also use CLASSORDER to change the order. &amp;nbsp;For this simple case, SGPLOT is good enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your code, the table is produced by a SCATTER where y=code. &amp;nbsp;This is not group order, but y order. &amp;nbsp;You can reverse the y axis for the 2nd cell. &amp;nbsp;But I would suggest using an AXISTABLE.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 03:40:34 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2016-12-01T03:40:34Z</dc:date>
    <item>
      <title>grouporder in proc template does not work</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315775#M11076</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dear Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is with regard to the query on sas graph which i am running on sas 9.4. Here i coded the proc template to create a graph.&lt;/P&gt;
&lt;P&gt;the graph comes perfectly fine. However the order of the group data in counts table below graph is not in a order, i want it as 1 2 3 and it is in 3 2 1. I tried to use the grouporder option with data, descending and ascending and nothing changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please suggest any other option by which i will get the order as 1 2 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template; 
define statgraph scatterplot; 
 begingraph; 
   entrytitle ' '; 

  discreteattrmap name="lbl" / ignorecase=true;
    value  "1" /
       markerattrs=GraphData1(color=blue  symbol=circlefilled size=5)
      ;
    value  "2" /
       markerattrs=GraphData2(color=green symbol=trianglefilled size=5)
       ; 
    value  "3" /
       markerattrs=GraphData3(color=red symbol=diamondfilled size=5)
       ;    
  enddiscreteattrmap;

discreteattrvar attrvar=lblmarker var=code attrmap="lbl";

layout lattice / columns=1 rows=2 rowweights=(.90 .10); 

       layout overlay / xaxisopts=( Label="Actual relative Time" type=discrete ) 
                       yaxisopts=( Label='Change in ALT(IU/L)' type=linear);       
           ScatterPlot X=xvar Y=yvar  /  Group=lblmarker GROUPDISPLAY=CLUSTER clusterwidth=0.7 LegendLabel="mean" NAME="SCATTER" ; 
referenceline y= 0 / lineattrs=(thickness=1 px color=black pattern=dot);
           DiscreteLegend "SCATTER" / border=yes  Location=outside valign=bottom title="Treatment Group:"; 
endlayout;

       &lt;FONT color="#FF0000"&gt;layout overlay / walldisplay=none border=false xaxisopts=(display=none type=discrete) 
                       yaxisopts=(Label=' ' type=linear linearopts=(tickvaluesequence=(start=1 end=3 increment=1) viewmin=1 viewmax=3 tickvaluelist=(1 2 3) 
                       tickvalueformat=(extractscale=true)) display=(label tickvalues)) ;       
           ScatterPlot X=xvarlbl Y=code / Group=lblmarker MARKERCHARACTER=count &lt;FONT color="#FF00FF"&gt;GROUPORDER=data&lt;/FONT&gt; DATALABELPOSITION=center;&lt;/FONT&gt; 
endlayout;
endlayout;
endgraph;
end;
run;


proc sgrender data=test2 template=scatterplot;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13213iCEA09F85CF24FB67/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 01 Dec 2016 03:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315775#M11076</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-12-01T03:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: grouporder in proc template does not work</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315783#M11077</link>
      <description>&lt;P&gt;Two points to make here. &amp;nbsp;With SAS 9.4, it is easier to use AXISTABLE to display the values at the bottom. &amp;nbsp;See &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/" target="_blank"&gt;article&lt;/A&gt;. &amp;nbsp;The stacking is done using CLASS variable, and you can also use CLASSORDER to change the order. &amp;nbsp;For this simple case, SGPLOT is good enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your code, the table is produced by a SCATTER where y=code. &amp;nbsp;This is not group order, but y order. &amp;nbsp;You can reverse the y axis for the 2nd cell. &amp;nbsp;But I would suggest using an AXISTABLE.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 03:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315783#M11077</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-12-01T03:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: grouporder in proc template does not work</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315861#M11079</link>
      <description>&lt;P&gt;Thank you Sanjay i agree with your suggestion of using the AXISTABLE. Alsoi followed your second appraoch for the moment by reversing the order of code and it re-ordered the counts data as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In continuation to this thread i would like to check with you if its also possible to put a label as &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;visit count &lt;/FONT&gt;&lt;/STRONG&gt;as displayed in the attached image.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13214i15F89A6BB6F329B5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 01 Dec 2016 09:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315861#M11079</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-12-01T09:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: grouporder in proc template does not work</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315939#M11080</link>
      <description>&lt;P&gt;Yes. &amp;nbsp;The AXISTABLE has a TITLE option for such purpose. &amp;nbsp;However, note this axistable title will go under the legend, and will not be drawn vertically like you have shown in the example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using a separate Layout Overlay like in your GTL code, the y axis title could be used for this by positoning it at the top of the axis. &amp;nbsp;See LABELPOSITION inYAXISOPTS in GTL.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 13:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315939#M11080</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-12-01T13:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: grouporder in proc template does not work</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315984#M11081</link>
      <description>Thank you Sanjay that resolved the issue.</description>
      <pubDate>Thu, 01 Dec 2016 15:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/grouporder-in-proc-template-does-not-work/m-p/315984#M11081</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-12-01T15:50:49Z</dc:date>
    </item>
  </channel>
</rss>

