<?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 Need help with sgplot stacked bar chart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763034#M21891</link>
    <description>&lt;P&gt;Hi I need some helps with sgplot.&lt;/P&gt;&lt;P&gt;I wish to build a couple of stacked bar chart with the code samples as below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=mydata noborder pctlevel=group;
 by Label notsorted;
 styleattrs datacolors=(bigb  bibg bio brown yellow red) ;
  vbar Day/group=Grade stat= pct groupdisplay=stack fill grouporder=ascending missing;
  xaxis integer values=(1 2 3 4 5 6 7);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At first, I want to make a 100% stacked bar chart (including missing value) on each Day. My data has 5 grade: 0,1,2,3,4 and missing data (display as "." bcs Grade is numeric variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And now I encounter 2 problems:&lt;/P&gt;&lt;P&gt;- How can I retain the percentage of other values on the bar on each day if I don't want the percentages of missing value and grade 0 to be displayed on my chart ?&lt;/P&gt;&lt;P&gt;- How can I fix the color code with each value eg I want missing value to be display with bigb color (as the order shown in&amp;nbsp;&lt;CODE class=" language-sas"&gt;datacolors=&lt;/CODE&gt; syntax)&lt;/P&gt;&lt;P&gt;Thanks in advance.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 21 Aug 2021 11:43:24 GMT</pubDate>
    <dc:creator>James_Yu</dc:creator>
    <dc:date>2021-08-21T11:43:24Z</dc:date>
    <item>
      <title>Need help with sgplot stacked bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763034#M21891</link>
      <description>&lt;P&gt;Hi I need some helps with sgplot.&lt;/P&gt;&lt;P&gt;I wish to build a couple of stacked bar chart with the code samples as below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=mydata noborder pctlevel=group;
 by Label notsorted;
 styleattrs datacolors=(bigb  bibg bio brown yellow red) ;
  vbar Day/group=Grade stat= pct groupdisplay=stack fill grouporder=ascending missing;
  xaxis integer values=(1 2 3 4 5 6 7);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At first, I want to make a 100% stacked bar chart (including missing value) on each Day. My data has 5 grade: 0,1,2,3,4 and missing data (display as "." bcs Grade is numeric variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And now I encounter 2 problems:&lt;/P&gt;&lt;P&gt;- How can I retain the percentage of other values on the bar on each day if I don't want the percentages of missing value and grade 0 to be displayed on my chart ?&lt;/P&gt;&lt;P&gt;- How can I fix the color code with each value eg I want missing value to be display with bigb color (as the order shown in&amp;nbsp;&lt;CODE class=" language-sas"&gt;datacolors=&lt;/CODE&gt; syntax)&lt;/P&gt;&lt;P&gt;Thanks in advance.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2021 11:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763034#M21891</guid>
      <dc:creator>James_Yu</dc:creator>
      <dc:date>2021-08-21T11:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with sgplot stacked bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763090#M21892</link>
      <description>Pre process your data so it’s summarized ahead of time. You can control your colours with items by using a data attribute map. &lt;BR /&gt;&lt;BR /&gt;A rough idea how to get the graph started can be found in this post which does a stacked bar chart in the first set of code I posted. &lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/GROTTA-BAR/m-p/762632" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/GROTTA-BAR/m-p/762632&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of data attribute map. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.11/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm#" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/8.11/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm#&lt;/A&gt;!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 22 Aug 2021 02:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763090#M21892</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-22T02:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with sgplot stacked bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763887#M21911</link>
      <description>Thanks alot.&lt;BR /&gt;This helps me to complete my code</description>
      <pubDate>Wed, 25 Aug 2021 15:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-help-with-sgplot-stacked-bar-chart/m-p/763887#M21911</guid>
      <dc:creator>James_Yu</dc:creator>
      <dc:date>2021-08-25T15:59:12Z</dc:date>
    </item>
  </channel>
</rss>

