<?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: Print names inside bars in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603230#M16914</link>
    <description>This is amazing. Thank You so much sir. #respect</description>
    <pubDate>Mon, 11 Nov 2019 14:59:45 GMT</pubDate>
    <dc:creator>arsinha</dc:creator>
    <dc:date>2019-11-11T14:59:45Z</dc:date>
    <item>
      <title>Print names inside bars</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603209#M16912</link>
      <description>&lt;P&gt;I have a data set with 3 variables as defined below -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;program 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;rank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp;&lt;/P&gt;&lt;P&gt;score&amp;nbsp; &amp;nbsp; 2.1&amp;nbsp; &amp;nbsp; &amp;nbsp;3.7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4.2&amp;nbsp; &amp;nbsp; &amp;nbsp;5.6&amp;nbsp; &amp;nbsp; &amp;nbsp; 6.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the output file from proc means as well with mean, std, min, max, etc.&lt;/P&gt;&lt;P&gt;I want to plot the score according to their ranks in a horizontal bar chart plot with the corresponding program names printed inside the bars.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The graph should like something like the drawn plot in the pdf attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used [proc template] and [proc sgrender] to plot the graph (which I cannot upload because it's from a project I am consulting on and I apologize for that) but I cannot get to print the program names for each bar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Neel.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 14:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603209#M16912</guid>
      <dc:creator>arsinha</dc:creator>
      <dc:date>2019-11-11T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Print names inside bars</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603227#M16913</link>
      <description>&lt;P&gt;I don't think you need to use PROC TEMPLATE for this. It is easy enough to create by using PROC SGPLOT. The key is to use the DATALABEL= option to specify the label (which you need to construct in a DATA step) and use the DATALABELFITPOLICY= option to put the label inside the bars:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input program score;
labl = cat("Program", put(program, 2.));
datalines;
1 2.1     
5 3.7
4 4.2
3 5.6
2 6.4
;

proc sort data=Have;
by descending Score;
run;

proc sgplot data=Have;
hbar program / response=score datalabel=labl datalabelfitpolicy=insidepreferred;
yaxis discreteorder=data display=(novalues noticks);&lt;BR /&gt;xaxis label="Score";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you do decide to use the GTL, the same options are supported by the BARCHARTPARM statement.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 14:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603227#M16913</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-11-11T14:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Print names inside bars</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603230#M16914</link>
      <description>This is amazing. Thank You so much sir. #respect</description>
      <pubDate>Mon, 11 Nov 2019 14:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Print-names-inside-bars/m-p/603230#M16914</guid>
      <dc:creator>arsinha</dc:creator>
      <dc:date>2019-11-11T14:59:45Z</dc:date>
    </item>
  </channel>
</rss>

