<?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: Descending values of  the vertical axis and position in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74325#M2736</link>
    <description>Like I said it has been a while since I did graphics.  You may want to annotate it.</description>
    <pubDate>Mon, 05 Oct 2009 17:42:58 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-10-05T17:42:58Z</dc:date>
    <item>
      <title>Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74316#M2727</link>
      <description>Hi to all,&lt;BR /&gt;
I've got the 2 following questions:&lt;BR /&gt;
1) I've to plot a gchart, where the hbar variable is numeric, and I've applied a format to show it. However, I need to put the values in descending order, but I couldn't find any way to do it (I cannot specify all the values, because the format does regroup the values)...any idea?&lt;BR /&gt;
2) I've been asked to put the vertical legend in the center of the graph, where the value is 0...I should use the annotate, but how?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Daniele</description>
      <pubDate>Mon, 05 Oct 2009 12:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74316#M2727</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-05T12:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74317#M2728</link>
      <description>Hi:&lt;BR /&gt;
  Look at the DESCENDING option of the HBAR statement:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gchart-bar.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gchart-bar.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  It will order the bars in descending order. For example, both HBAR statements will generate bars in descending order:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc gchart data=sashelp.class;&lt;BR /&gt;
hbar age /levels=6 descending ;&lt;BR /&gt;
hbar age / discrete descending;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
I'm not sure I understand what you mean by vertical legend?? You mean the position of the statistics?? Or are you using SUBGROUP= that has a legend??? The SUBGROUP legend can be controlled by the LEGEND statement.&lt;BR /&gt;
&lt;BR /&gt;
However, for more information about using the ANNOTATE facility, refer to these sites for a place to start with Annotate:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/annodata-ov.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/annodata-ov.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/a002093540.htm#ganvbar-ex" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/a002093540.htm#ganvbar-ex&lt;/A&gt; http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/annotate_annotate.htm&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi31/085-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/085-31.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi31/108-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/108-31.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://analytics.ncsu.edu/sesug/2001/P-606.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2001/P-606.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.nesug.org/Proceedings/nesug97/infviz/mendelso.pdf" target="_blank"&gt;http://www.nesug.org/Proceedings/nesug97/infviz/mendelso.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.lexjansen.com/mwsug/2007/DataVisualization/D04-2007.pdf" target="_blank"&gt;http://www.lexjansen.com/mwsug/2007/DataVisualization/D04-2007.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
And, this site has a wealth of SAS/GRAPH  and ANNOTATE examples:&lt;BR /&gt;
&lt;A href="http://robslink.com/SAS/Home.htm" target="_blank"&gt;http://robslink.com/SAS/Home.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 05 Oct 2009 15:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74317#M2728</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-05T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74318#M2729</link>
      <description>Daniele;&lt;BR /&gt;
&lt;BR /&gt;
Based on your vertical axis question, It seems that you have negative and positive values.  Proc GChart HBar will automaitically place the vertical axis at zero.&lt;BR /&gt;
Example below;&lt;BR /&gt;
data a;                                                                                                                                 &lt;BR /&gt;
input a $ b;                                                                                                                            &lt;BR /&gt;
cards;                                                                                                                                  &lt;BR /&gt;
a 1                                                                                                                                     &lt;BR /&gt;
b -1                                                                                                                                    &lt;BR /&gt;
c 5                                                                                                                                     &lt;BR /&gt;
d -1                                                                                                                                    &lt;BR /&gt;
;                                                                                                                                       &lt;BR /&gt;
run;                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
proc gchart;                                                                                                                            &lt;BR /&gt;
hbar a/sumvar=b;                                                                                                                        &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
quit;</description>
      <pubDate>Mon, 05 Oct 2009 15:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74318#M2729</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2009-10-05T15:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74319#M2730</link>
      <description>Dear Cynthia,&lt;BR /&gt;
I've tried the descending option, but I believe it works with the sumvar variable, and not the hbar one (in fact, I get some weird ordered diagram, but which is ordered by the sum of the positive values and negative values of the sumvar variable)...I'm pretty sure of the format I'm using, since it's quite simple...&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Daniele</description>
      <pubDate>Mon, 05 Oct 2009 16:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74319#M2730</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-05T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74320#M2731</link>
      <description>Dear Bill,&lt;BR /&gt;
thank you for your kind answer, but I believe I didn't express myself correctly: what I want is the legend of the vertical axes in the center of the graph (normally is on the left, since this is a hbar graph). Is it possible?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Daniele</description>
      <pubDate>Mon, 05 Oct 2009 16:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74320#M2731</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-05T16:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74321#M2732</link>
      <description>If the axis values are already known, the simpliest approach it to specify the values on the MIDPOINTS= option in descending order.  If they are no known, there are some techniques for generating this midpoint list dynamically using a macro.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Mon, 05 Oct 2009 16:42:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74321#M2732</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-10-05T16:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74322#M2733</link>
      <description>Hi Dan,&lt;BR /&gt;
I'm not sure of what you have explained on your post...how I should use midpoints?&lt;BR /&gt;
Let me explain my dataset: I've got values for all the range of different ages from 0 to over 80 years, and I've to plot the values on a hbar diagram, where:&lt;BR /&gt;
1) I've applied a format for the age, which groups the ages in 5 years segments (0-4 years, over 80 years old, and so on)&lt;BR /&gt;
2) I'd like to show this diagram in this order:&lt;BR /&gt;
80 years and over old&lt;BR /&gt;
75 to 79 old&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;BR /&gt;
0 to 4 years old&lt;BR /&gt;
3) This legend (which are the ages formatted) should be pun in the center of the graph, where tha value is 0 (the fact is that I've got also negative values, and the legend is at the left of the negative).&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Daniele</description>
      <pubDate>Mon, 05 Oct 2009 17:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74322#M2733</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-05T17:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74323#M2734</link>
      <description>It has been a long time, but isn't that what the ORIGIN= option on the axis statement does?</description>
      <pubDate>Mon, 05 Oct 2009 17:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74323#M2734</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-10-05T17:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74324#M2735</link>
      <description>Hi Flip,&lt;BR /&gt;
maybe I'm using wrongly the origin option, but it doesn't only move the legend, but it also stretches the diagram...at the point that it doesn't put the legend inside the graph &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Mon, 05 Oct 2009 17:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74324#M2735</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-05T17:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74325#M2736</link>
      <description>Like I said it has been a while since I did graphics.  You may want to annotate it.</description>
      <pubDate>Mon, 05 Oct 2009 17:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74325#M2736</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-10-05T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74326#M2737</link>
      <description>Hey Daniele,&lt;BR /&gt;
&lt;BR /&gt;
What do you get if you add this option to your HBAR statement:&lt;BR /&gt;
&lt;BR /&gt;
midpoints=(80 to 0 by -5)&lt;BR /&gt;
&lt;BR /&gt;
-- Dan</description>
      <pubDate>Mon, 05 Oct 2009 20:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74326#M2737</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-10-05T20:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74327#M2738</link>
      <description>I don't see how you can avoid replacing the format by a hard-coded age that is the same for each group.&lt;BR /&gt;
&lt;BR /&gt;
You can then use the midpoints option to force the order.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;I've been asked to put the vertical legend ...&lt;BR /&gt;
&lt;BR /&gt;
You mean the axis label?</description>
      <pubDate>Tue, 06 Oct 2009 01:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74327#M2738</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-10-06T01:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74328#M2739</link>
      <description>Hi to all,&lt;BR /&gt;
for the first problem, I've solved by proc tabulating first with the format, and outputting the results in a dataset, that I've used with the proc gchart. In this way I've got one observation for class, and it's easy to order it as I want.&lt;BR /&gt;
For the second point...yes Chris, I mean the axis1 legend...&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Daniele

Edit: no, I was wrong, I meant the label &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Daniele Tiles</description>
      <pubDate>Wed, 07 Oct 2009 07:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74328#M2739</guid>
      <dc:creator>DanieleTiles</dc:creator>
      <dc:date>2009-10-07T07:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Descending values of  the vertical axis and position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74329#M2740</link>
      <description>This should get you started:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data T; &lt;BR /&gt;
  set SASHELP.CLASS;&lt;BR /&gt;
  AGE+-13;&lt;BR /&gt;
run;&lt;BR /&gt;
data ANNO;&lt;BR /&gt;
   XSYS     = '5';         * X coordinates use % of graphics output area ;&lt;BR /&gt;
   YSYS     = '2';         * Y coordinates use data values ;&lt;BR /&gt;
   FUNCTION = 'label';     * I want to write a string;&lt;BR /&gt;
   TEXT     = 'My label';  * This is the string;&lt;BR /&gt;
   X        = 5;           * Write at position X=5 (% of graphics output area); &lt;BR /&gt;
   Y        = 0;           * Write at Y=O (data value);&lt;BR /&gt;
run;&lt;BR /&gt;
axis1 label=(c=red 'free up space, should be white' );&lt;BR /&gt;
proc gchart data=T annotate=ANNO;&lt;BR /&gt;
  hbar AGE / discrete nostats maxis=axis1;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;</description>
      <pubDate>Thu, 08 Oct 2009 01:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Descending-values-of-the-vertical-axis-and-position/m-p/74329#M2740</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-10-08T01:00:16Z</dc:date>
    </item>
  </channel>
</rss>

