<?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: discrete order on grouped barchart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73401#M2672</link>
    <description>Thank you Dan. I was hoping for a nice option for this, since i have a lot of variables and formats for my graphs. Well, well. &lt;BR /&gt;
&lt;BR /&gt;
I will put the text in the label instead, as you suggested.&lt;BR /&gt;
&lt;BR /&gt;
Tks&lt;BR /&gt;
jenny</description>
    <pubDate>Mon, 28 Sep 2009 15:20:32 GMT</pubDate>
    <dc:creator>Jennys</dc:creator>
    <dc:date>2009-09-28T15:20:32Z</dc:date>
    <item>
      <title>discrete order on grouped barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73399#M2670</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I have a grouped barchart that I want to sort by the group variable. In the example below the graph starts with the lowest value on variable group (1949-1953) , but I want it to start with the highest value. Ie it should start with group 1959-1963. I have tried to use the discreteorder = data on the colaxis, but that option affects the values within each group.  Is this possible?&lt;BR /&gt;
&lt;BR /&gt;
I also want to have only ONE label on the reference line, in this case 3 labels are printed...&lt;BR /&gt;
&lt;BR /&gt;
tks &lt;BR /&gt;
jenny&lt;BR /&gt;
&lt;BR /&gt;
/* ---------- Code ---------------------*/ &lt;BR /&gt;
proc format;&lt;BR /&gt;
  value sex&lt;BR /&gt;
  1 = 'Male'&lt;BR /&gt;
  2 = 'Female';&lt;BR /&gt;
  run;&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value group&lt;BR /&gt;
  1 = '1949-1953'&lt;BR /&gt;
  2 = '1954-1958'&lt;BR /&gt;
  3 = '1959-1963';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data chartds;&lt;BR /&gt;
  medel = 150; group = 1; sex = 1;output;&lt;BR /&gt;
  medel = 180; group = 1; sex = 2;output;&lt;BR /&gt;
  medel = 200; group = 2; sex = 2;output;&lt;BR /&gt;
  medel = 100; group = 2; sex = 1;output;&lt;BR /&gt;
  medel = 80;  group = 3; sex = 2;output;&lt;BR /&gt;
  medel = 130; group = 3; sex = 1;output;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
/* Order the data by group */&lt;BR /&gt;
proc sort data = chartds;&lt;BR /&gt;
  by  descending group;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sgpanel data=chartds; &lt;BR /&gt;
panelby group / layout=columnlattice &lt;BR /&gt;
onepanel noborder novarname &lt;BR /&gt;
colheaderpos=bottom; &lt;BR /&gt;
vbar sex / response=medel group=sex; &lt;BR /&gt;
rowaxis grid offsetmax=0.05 ; &lt;BR /&gt;
colaxis display=none discreteorder=data ; &lt;BR /&gt;
 refline 110 /label=("Test refline") lineattrs=(pattern=2 thickness=2px color=black);&lt;BR /&gt;
 format sex sex. group group. ;label medel = 'eu/hour';&lt;BR /&gt;
          label group = "Age class";&lt;BR /&gt;
  keylegend /position=bottom title="Salary"; &lt;BR /&gt;
run;</description>
      <pubDate>Sun, 27 Sep 2009 17:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73399#M2670</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2009-09-27T17:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: discrete order on grouped barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73400#M2671</link>
      <description>Currently, the values for the panel variable are always sorted ascending.  You can work around this by assigning your numeric tags in reverse numerical order.  As for the reference line, the reference line specification is replaced in each cell, which is why you get the label three time.  Another way to label is to put the reference line label in a legend. Try the modified code below and see if that labeling works for you.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan&lt;BR /&gt;
&lt;BR /&gt;
proc sgpanel data=chartds;&lt;BR /&gt;
panelby group / layout=columnlattice&lt;BR /&gt;
onepanel noborder novarname&lt;BR /&gt;
colheaderpos=bottom;&lt;BR /&gt;
vbar sex / response=medel group=sex name="bar";&lt;BR /&gt;
rowaxis grid offsetmax=0.05 ;&lt;BR /&gt;
colaxis display=none discreteorder=data ;  &lt;BR /&gt;
refline 110 / legendlabel="Test refline" name="ref"&lt;BR /&gt;
              lineattrs=(pattern=2 thickness=2px color=black);  &lt;BR /&gt;
format sex sex. group group. ;&lt;BR /&gt;
label medel = 'eu/hour';&lt;BR /&gt;
label group = "Age class";&lt;BR /&gt;
keylegend "bar" "ref" /position=bottom title="Salary"; run;</description>
      <pubDate>Mon, 28 Sep 2009 13:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73400#M2671</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-09-28T13:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: discrete order on grouped barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73401#M2672</link>
      <description>Thank you Dan. I was hoping for a nice option for this, since i have a lot of variables and formats for my graphs. Well, well. &lt;BR /&gt;
&lt;BR /&gt;
I will put the text in the label instead, as you suggested.&lt;BR /&gt;
&lt;BR /&gt;
Tks&lt;BR /&gt;
jenny</description>
      <pubDate>Mon, 28 Sep 2009 15:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/discrete-order-on-grouped-barchart/m-p/73401#M2672</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2009-09-28T15:20:32Z</dc:date>
    </item>
  </channel>
</rss>

