<?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: stacked barchart - how to order the legend and the xaxis table? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646680#M19863</link>
    <description>Sory if it confused you. Im interested in changing the order of colaxistable.</description>
    <pubDate>Mon, 11 May 2020 13:07:00 GMT</pubDate>
    <dc:creator>Manj</dc:creator>
    <dc:date>2020-05-11T13:07:00Z</dc:date>
    <item>
      <title>stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646645#M19857</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have this code to create the graph attached.&lt;/P&gt;&lt;P&gt;proc sgpanel data=&amp;amp;G_DDDATASETNAME pctlevel=group ;&lt;BR /&gt;panelby trt01p / layout=columnlattice onepanel novarname colheaderpos=bottom headerattrs=(Size=8) ;&lt;BR /&gt;vbar avisit / group=avalc stat=percent grouporder=ascending attrid=avalc;&lt;BR /&gt;styleattrs datacolors=(white lightgrey darkgrey grey black) datacontrastcolours=( black black black black black);&lt;BR /&gt;colaxis display=(nolabel) valueattrs=(size=8);&lt;BR /&gt;rowaxis label='Percentage of Patients' ;&lt;BR /&gt;keylegend /title='PGI-S response categories:' valueattrs=(size=8);&lt;BR /&gt;colaxistable avalx / class=avalx classdisplay=stack stat=freq labelpos=right classorder=ascending labelattrs=(size=8) valueattrs=(size=8);&lt;BR /&gt;run;&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="Manj_0-1589196986066.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39279iA27413B7180FBADC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Manj_0-1589196986066.png" alt="Manj_0-1589196986066.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like the xaxis to be ordred the reverseorder from the above graph, I tried using different options of 'classorder' which doesnt seems to have any effect.Kidnly help?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 11:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646645#M19857</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-11T11:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646669#M19858</link>
      <description>&lt;P&gt;you can try the keylegend option as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;keylegend /title='PGI-S response categories:' valueattrs=(size=8) SORTORDER=DESCENDING;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 12:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646669#M19858</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-05-11T12:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646672#M19859</link>
      <description>Thanks. This works only for legends and not colaxistable</description>
      <pubDate>Mon, 11 May 2020 12:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646672#M19859</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-11T12:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646673#M19860</link>
      <description>&lt;P&gt;Will the REVERSE option on the COLAXIS statement give you what you want?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646673#M19860</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-05-11T12:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646674#M19861</link>
      <description>I have tried all the options of CLASSORDER=DATA | REVERSEDATA | ASCENDING | DESCENDING and none were working&lt;BR /&gt;</description>
      <pubDate>Mon, 11 May 2020 13:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646674#M19861</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-11T13:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646675#M19862</link>
      <description>&lt;P&gt;Just to be clear: are you trying to change the order of the XAXIS or the XAXISTABLE? The original request said XAXIS, but the XAXISTABLE is circled.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 13:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646675#M19862</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-05-11T13:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646680#M19863</link>
      <description>Sory if it confused you. Im interested in changing the order of colaxistable.</description>
      <pubDate>Mon, 11 May 2020 13:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646680#M19863</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-11T13:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646682#M19864</link>
      <description>&lt;P&gt;To get what you want for the axis table, you will will need to presort the data and use REVERSEDATA on the CLASSORDER option. The PROC SORT will look something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=data=&amp;amp;G_DDDATASETNAME;
by&amp;nbsp;trt01p&amp;nbsp;avisit&amp;nbsp;avalc&amp;nbsp;avalx;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the sorts on your VBAR and COLAXISTABLE statements will change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=&amp;amp;G_DDDATASETNAME pctlevel=group ;
panelby trt01p / layout=columnlattice onepanel novarname colheaderpos=bottom headerattrs=(Size=8) ;
vbar avisit / group=avalc stat=percent grouporder=data attrid=avalc;
styleattrs datacolors=(white lightgrey darkgrey grey black) datacontrastcolours=( black black black black black);
colaxis display=(nolabel) valueattrs=(size=8);
rowaxis label='Percentage of Patients' ;
keylegend /title='PGI-S response categories:' valueattrs=(size=8);
colaxistable avalx / class=avalx classdisplay=stack stat=freq labelpos=right classorder=reversedata labelattrs=(size=8) valueattrs=(size=8);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 13:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646682#M19864</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-05-11T13:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646725#M19865</link>
      <description>No Luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Mon, 11 May 2020 14:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646725#M19865</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-11T14:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646730#M19866</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/115109"&gt;@Manj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No Luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"No luck" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the &amp;lt;&amp;gt; to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also need to examine which version of SAS you are running. The options in the graphics outputs are one of the fastest changing elements and if you are running an older version the options recommended may not suffice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But Data and actual code really help diagnose things.The implication that you implemented &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;'s suggestion does not mean that the code you submitted actually aligned with the suggestion. We have seen numerous examples of "doesn't work" and when we finally get the actual as ran code from a log find things like misspelled variables, order of by statements not matching, missing by variables and sometimes even errors that occur before the graphic procedure so that changes to data are not actually occurring so the procedure is still plotting the older data.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 14:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646730#M19866</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-11T14:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: stacked barchart - how to order the legend and the xaxis table?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646776#M19871</link>
      <description>&lt;P&gt;You will need to presummarize the data and use VBARPARM instead of VBAR. That way the CLASSORDER option will be honored on the COLAXISTABLE statement. Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.prdsale nway;
class year region product;
var actual;
output out=prdsale sum=;
run;

proc sort data=prdsale;
by year region product;
run;

proc sgpanel data=prdsale;
panelby year;
vbarparm category=region response=actual / group=product grouporder=data;
colaxistable actual / class=product classorder=reversedata;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 15:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/stacked-barchart-how-to-order-the-legend-and-the-xaxis-table/m-p/646776#M19871</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-05-11T15:43:51Z</dc:date>
    </item>
  </channel>
</rss>

