<?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: assigning  colors to each hbar sgplots in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406519#M13886</link>
    <description>&lt;P&gt;Or use this example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/43/731.html" target="_blank"&gt;http://support.sas.com/kb/43/731.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, what you need is the data attrmap step which contains a datalines statement containing the variables you would like to group by color:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data attrmap;&lt;/STRONG&gt;&lt;BR /&gt; /* The ID required variable contains the name of the attribute map */&lt;BR /&gt; /* The VALUE required variable contains the value of the GROUP variable, &lt;BR /&gt; which in this case is FLAVOR */&lt;BR /&gt; /* The FILLCOLOR variable is used to change the color for the bars created by the VBAR &lt;BR /&gt; statement. */&lt;/P&gt;
&lt;P&gt;input id $ value $10. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131792"&gt;@19&lt;/a&gt; fillcolor $8.;&lt;BR /&gt; datalines;&lt;BR /&gt;flavor&lt;U&gt; Vanilla&lt;/U&gt; &lt;STRONG&gt;beige&lt;/STRONG&gt; &lt;BR /&gt;flavor &lt;U&gt;Chocolate&lt;/U&gt; &lt;STRONG&gt;cx663D29&lt;/STRONG&gt; &lt;BR /&gt;flavor &lt;U&gt;Strawberry&lt;/U&gt;&lt;STRONG&gt; pink&lt;/STRONG&gt; &lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, in your proc sgplot statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* The DATTRMAP option references the attribute map data set */&lt;BR /&gt;proc sgplot data=icecream dattrmap=attrmap;&lt;BR /&gt; format sex $fmt.;&lt;BR /&gt; /* The ATTRID option references the name of the attribute map */&lt;BR /&gt; vbar sex / group=flavor response=count groupdisplay=cluster &lt;BR /&gt; dataskin=pressed attrid=flavor;&lt;BR /&gt; xaxis display=(nolabel noticks);&lt;BR /&gt; yaxis label='Count of Participants';&lt;BR /&gt; keylegend / title='Ice Cream Flavor';&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 13:40:22 GMT</pubDate>
    <dc:creator>danielduval0</dc:creator>
    <dc:date>2017-10-23T13:40:22Z</dc:date>
    <item>
      <title>assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406494#M13884</link>
      <description>&lt;P&gt;Is there anyway to assign color to each stacked bar just like using pattern in a pie chart (gchart). I want these colors to be outputted in a particular order. I will be grateful with any help&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 12:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406494#M13884</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-23T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406511#M13885</link>
      <description>&lt;P&gt;See the following post:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/PROC-SGPLOT-How-to-use-Custom-Colors-in-Stacked-Bar-Chart/td-p/206900" target="_blank"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/PROC-SGPLOT-How-to-use-Custom-Colors-in-Stacked-Bar-Chart/td-p/206900&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this does not answer your question!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 13:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406511#M13885</guid>
      <dc:creator>danielduval0</dc:creator>
      <dc:date>2017-10-23T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406519#M13886</link>
      <description>&lt;P&gt;Or use this example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/43/731.html" target="_blank"&gt;http://support.sas.com/kb/43/731.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, what you need is the data attrmap step which contains a datalines statement containing the variables you would like to group by color:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data attrmap;&lt;/STRONG&gt;&lt;BR /&gt; /* The ID required variable contains the name of the attribute map */&lt;BR /&gt; /* The VALUE required variable contains the value of the GROUP variable, &lt;BR /&gt; which in this case is FLAVOR */&lt;BR /&gt; /* The FILLCOLOR variable is used to change the color for the bars created by the VBAR &lt;BR /&gt; statement. */&lt;/P&gt;
&lt;P&gt;input id $ value $10. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131792"&gt;@19&lt;/a&gt; fillcolor $8.;&lt;BR /&gt; datalines;&lt;BR /&gt;flavor&lt;U&gt; Vanilla&lt;/U&gt; &lt;STRONG&gt;beige&lt;/STRONG&gt; &lt;BR /&gt;flavor &lt;U&gt;Chocolate&lt;/U&gt; &lt;STRONG&gt;cx663D29&lt;/STRONG&gt; &lt;BR /&gt;flavor &lt;U&gt;Strawberry&lt;/U&gt;&lt;STRONG&gt; pink&lt;/STRONG&gt; &lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, in your proc sgplot statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* The DATTRMAP option references the attribute map data set */&lt;BR /&gt;proc sgplot data=icecream dattrmap=attrmap;&lt;BR /&gt; format sex $fmt.;&lt;BR /&gt; /* The ATTRID option references the name of the attribute map */&lt;BR /&gt; vbar sex / group=flavor response=count groupdisplay=cluster &lt;BR /&gt; dataskin=pressed attrid=flavor;&lt;BR /&gt; xaxis display=(nolabel noticks);&lt;BR /&gt; yaxis label='Count of Participants';&lt;BR /&gt; keylegend / title='Ice Cream Flavor';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 13:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/406519#M13886</guid>
      <dc:creator>danielduval0</dc:creator>
      <dc:date>2017-10-23T13:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407134#M13906</link>
      <description>&lt;P&gt;&amp;nbsp;Thanks for the idea. I will apply it and leave a feedback&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 06:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407134#M13906</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-25T06:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407143#M13907</link>
      <description>&lt;P&gt;Thanks it worked fine.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 07:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407143#M13907</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-25T07:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: assigning  colors to each hbar sgplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407278#M13911</link>
      <description>&lt;P&gt;Great news! I am glad I was able to help.&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, 25 Oct 2017 13:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/assigning-colors-to-each-hbar-sgplots/m-p/407278#M13911</guid>
      <dc:creator>danielduval0</dc:creator>
      <dc:date>2017-10-25T13:57:11Z</dc:date>
    </item>
  </channel>
</rss>

