<?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: data labels in each section of sgplot stacked bar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103951#M3867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are ways to do this, but not by using a simple option on VBAR or VBARPARM.&amp;nbsp; Sort the values by category and group, and compute the low, high values (and midpoint) for each bar segment per category yourself.&amp;nbsp; Then, use a HIGHLOW bar to draw the segments.&amp;nbsp; Use a SCATTER plot with MARKERCHAR to place the values at the midpoint of each segment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jun 2013 14:46:20 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2013-06-14T14:46:20Z</dc:date>
    <item>
      <title>data labels in each section of sgplot stacked bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103949#M3865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a command to put data labels in each bar of a chart?&amp;nbsp; This is what I have:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;proc sgplot data=figure2;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; yaxis label=' ' discreteorder=data valueATTRS=(family='calibri' size=8pt style=normal);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; xaxis discreteorder=data label = ' ' valueATTRS=(family='calibri' size=8pt style=normal);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; vbar group / response = col1 group = name grouporder=data barwidth=0.4 datalabel=col1 datalabelpos=data;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; keylegend / noborder location=outside position=top across=2 valueATTRS=(family='calibri' size=7pt style=normal);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; run;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Using this code gives me the value from the first segment of the stacked bar, at the top of the bar.&amp;nbsp; Using datalabel by itself gives the grand total at the top.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need each segment to have it's own label, and some segments are too small for the value, so it would need to be off to the side.&amp;nbsp; Is there a way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11464iEC51487570BA00C1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="barchart_sample.JPG" title="barchart_sample.JPG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103949#M3865</guid>
      <dc:creator>onpoint1</dc:creator>
      <dc:date>2013-06-12T15:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: data labels in each section of sgplot stacked bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103950#M3866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This doesn't do what the bosses requested, but at least the data is available on the chart: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=figure2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis label=' ' discreteorder=data valueattrs=(family='calibri' size=8pt style=normal) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xaxis discreteorder=data label = ' ' valueattrs=(family='calibri' size=8pt style=normal) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbar group / response = col1 group = name grouporder=data barwidth=0.4 &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt; datalabel=col1 datalabelpos=bottom &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalabelattrs=(family='calibri' size=6pt style=normal); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keylegend / noborder location=outside position=top across=2 valueattrs=(family='calibri' size=7pt style=normal);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;It seems logical from the documentation that the datalabelpos=data option should label the data sections, it just doesn't.&amp;nbsp; I've seen other similar questions on various Communities boards but no easy answers.&amp;nbsp; Is Annotate the only option?&amp;nbsp; If anyone knows a great simple solution, I'd still like to see it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 14:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103950#M3866</guid>
      <dc:creator>onpoint1</dc:creator>
      <dc:date>2013-06-13T14:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: data labels in each section of sgplot stacked bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103951#M3867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are ways to do this, but not by using a simple option on VBAR or VBARPARM.&amp;nbsp; Sort the values by category and group, and compute the low, high values (and midpoint) for each bar segment per category yourself.&amp;nbsp; Then, use a HIGHLOW bar to draw the segments.&amp;nbsp; Use a SCATTER plot with MARKERCHAR to place the values at the midpoint of each segment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 14:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/data-labels-in-each-section-of-sgplot-stacked-bar/m-p/103951#M3867</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2013-06-14T14:46:20Z</dc:date>
    </item>
  </channel>
</rss>

