<?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: Define statgraph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762186#M21871</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392462"&gt;@katslau&lt;/a&gt;, it helps if you also include your data and/or your graph when you make a post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not want to display the treatment on the x-axis then you can use the DISPLAY option to select the parts of the XAXIS that you want to display. Try this code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph barchart;
    begingraph;
      entrytitle "What cancer treatment(s) have you had?";
      layout overlay / XAXISOPTS = (DISPLAY=(LINE TICKS TICKVALUES));
        barchart category=treatment response=frequency /
          stat=mean orient=horizontal;
      endlayout;
  endgraph;
end;

proc sgrender data=sasdata.augtx2021 template=barchart;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Aug 2021 22:12:07 GMT</pubDate>
    <dc:creator>djrisks</dc:creator>
    <dc:date>2021-08-17T22:12:07Z</dc:date>
    <item>
      <title>Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762177#M21870</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm totally new to SAS. I want to display a barchart of a question from a survey which can have multiple answers, so I have a table of the different treatments that were selected by the participants and their counts. I used the new define statgraph feature to generate the barchart instead of using the stat vertical bar chart. I used the template from the documentation. I would like to NOT display the "treatment" in the xaxis because the labels of the variables are self-explanatory. Below is what I have. What code do I need to have to tell it not display the label?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;define statgraph barchart;&lt;BR /&gt;begingraph;&lt;BR /&gt;entrytitle "What cacner treatment(s) have you had?";&lt;BR /&gt;layout overlay;&lt;BR /&gt;barchart category=treatment response=frequency /&lt;BR /&gt;stat=mean orient=horizontal;&lt;BR /&gt;endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;proc sgrender data=sasdata.augtx2021 template=barchart;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 21:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762177#M21870</guid>
      <dc:creator>katslau</dc:creator>
      <dc:date>2021-08-17T21:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762186#M21871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392462"&gt;@katslau&lt;/a&gt;, it helps if you also include your data and/or your graph when you make a post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not want to display the treatment on the x-axis then you can use the DISPLAY option to select the parts of the XAXIS that you want to display. Try this code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph barchart;
    begingraph;
      entrytitle "What cancer treatment(s) have you had?";
      layout overlay / XAXISOPTS = (DISPLAY=(LINE TICKS TICKVALUES));
        barchart category=treatment response=frequency /
          stat=mean orient=horizontal;
      endlayout;
  endgraph;
end;

proc sgrender data=sasdata.augtx2021 template=barchart;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Aug 2021 22:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762186#M21871</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-17T22:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762188#M21872</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392462"&gt;@katslau&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;using a template (with PROC TEMPLATE + PROC SGRENDER) is absolute overkill for the required plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would use a HBAR or VBAR statement in PROC SGPLOT (SG = Statistical Graphics).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Submit the below code to find out how this can be done:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.heart;
  title "Smoking_Status 'Distribution'";
  hbar Smoking_Status;
  keylegend / location=inside position=topright;
  yaxis display=(nolabel);
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 22:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762188#M21872</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-08-17T22:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762201#M21873</link>
      <description>&lt;P&gt;Yes, that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 23:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762201#M21873</guid>
      <dc:creator>katslau</dc:creator>
      <dc:date>2021-08-17T23:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762227#M21874</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;One more question (it's probably very trivia to you): If I want to add the value of the counts to the bar (i.e. at the top of the bar), how would I do that? Something like this chart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="katslau_1-1629268136356.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62675i9B8AE309D2647A4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="katslau_1-1629268136356.png" alt="katslau_1-1629268136356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I attached the table for the treatment data.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762227#M21874</guid>
      <dc:creator>katslau</dc:creator>
      <dc:date>2021-08-18T06:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762237#M21878</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392462"&gt;@katslau&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for attaching the data!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To add the value of the counts to the bar, you can use the BARLABEL=TRUE option within the BARCHART statement. Please see the example code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph barchart;
    begingraph;
      entrytitle "What cancer treatment(s) have you had?";
      layout overlay / YAXISOPTS = (DISPLAY=(LINE TICKS TICKVALUES));
        barchart category=treatment response=frequency /
          stat=mean orient=horizontal &lt;STRONG&gt;&lt;FONT color="#00FF00"&gt;BARLABEL=true&lt;/FONT&gt;&lt;/STRONG&gt;;
      endlayout;
  endgraph;
end;

proc sgrender data=sasdata.augtx2021 template=barchart;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 07:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762237#M21878</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-18T07:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Define statgraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762398#M21879</link>
      <description>&lt;P&gt;Yes, that works. I tried that before emailing you and it didn't work. It must be because I didn't put the label at the appropriate place...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 23:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Define-statgraph/m-p/762398#M21879</guid>
      <dc:creator>katslau</dc:creator>
      <dc:date>2021-08-18T23:15:47Z</dc:date>
    </item>
  </channel>
</rss>

