<?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: Keeping the colors for category constant at all times in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975224#M378066</link>
    <description>This solution is used in the by group scenario. In the data set I have categories are kept in the group = option</description>
    <pubDate>Wed, 17 Sep 2025 11:08:42 GMT</pubDate>
    <dc:creator>mmohotsi</dc:creator>
    <dc:date>2025-09-17T11:08:42Z</dc:date>
    <item>
      <title>Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975220#M378064</link>
      <description>&lt;P&gt;Good day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set that changes depending on the attributes in the database. I am trying to draw a stack graph for this data set. The data set is as in the attached files. The program below provides a graph with the following colors to the distinct groups:&lt;/P&gt;
&lt;P&gt;White color - Out of commission&lt;/P&gt;
&lt;P&gt;Yellow color: sampled not scheduled&lt;/P&gt;
&lt;P&gt;Blue color :Recommissioned&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I keep&amp;nbsp; the colors constant to each of these groups regardless of whether a certain category is available&amp;nbsp; or not in the extracted data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code I used is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data = data.Data_Raw pctlevel=group noborder ;&lt;BR /&gt;styleattrs datacolors=( deepskyblue yellow white ) ; &lt;BR /&gt;vbar PIPELINE / stat=pct group = Screen_0001 groupdisplay=stack name='Barcharts' &lt;BR /&gt;barwidth=0.5 ;&lt;BR /&gt;keylegend 'Barcharts' / TITLEATTRS=(weight=bold family=Helvetica size=5) position=bottom noborder;&lt;BR /&gt;yaxis label='% Composition' LABELATTRS=(weight=normal size=12);&lt;BR /&gt;xaxis display=(nolabel) valuesrotate=vertical;&lt;BR /&gt;title "Graphical representation" justify=right;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 10:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975220#M378064</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2025-09-17T10:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975222#M378065</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-How-to-get-consistent-colors-across-BY-groups/td-p/668774" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-How-to-get-consistent-colors-across-BY-groups/td-p/668774&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 10:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975222#M378065</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-17T10:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975224#M378066</link>
      <description>This solution is used in the by group scenario. In the data set I have categories are kept in the group = option</description>
      <pubDate>Wed, 17 Sep 2025 11:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975224#M378066</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2025-09-17T11:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975226#M378067</link>
      <description>&lt;P&gt;In the link, the colors are assigned to the values of the variable in the GROUP= option. Works with or without a BY variable.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 11:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975226#M378067</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-17T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975245#M378069</link>
      <description>&lt;P&gt;Thanks PaigeMiller&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the solution to my challenge&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;mmohotsi&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 15:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975245#M378069</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2025-09-17T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping the colors for category constant at all times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975320#M378085</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77934"&gt;@mmohotsi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be kind enough to un-mark your comment as a solution (since it is not a solution in any meaningful sense) and mark the link I provided as the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 12:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-the-colors-for-category-constant-at-all-times/m-p/975320#M378085</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-18T12:41:28Z</dc:date>
    </item>
  </channel>
</rss>

