<?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 Change fill colours on a stacked bar chart (SGPLOT) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-fill-colours-on-a-stacked-bar-chart-SGPLOT/m-p/473972#M30743</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a stacked bar graph and I need to change the colours of the bars after the 25th June 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I use to create the chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT data=work.MERGETEST noborder;
Title "Test";
VBAR EVENT_DT / RESPONSE=COUNT GROUP=CONTACT;
 yaxis display=(noline noticks) grid values=(0 to 100000 by 1000) offsetmin=0
		label='Count' ;
	inset 'Change started on the 25 June 2018' / position= topright border;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have used the following to change the fill colour in a single bar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Attrmap;
	Retain id "myid";
	input value $ fillcolor $8.;
	datalines;
	0 VIBG
	1 BIBG
	;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and use&amp;nbsp;dattrmap=attrmap&amp;nbsp; attrid=myid in the SGPLOT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I now change it to colour the stacked bar chart&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 04:42:58 GMT</pubDate>
    <dc:creator>DME790</dc:creator>
    <dc:date>2018-06-28T04:42:58Z</dc:date>
    <item>
      <title>Change fill colours on a stacked bar chart (SGPLOT)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-fill-colours-on-a-stacked-bar-chart-SGPLOT/m-p/473972#M30743</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a stacked bar graph and I need to change the colours of the bars after the 25th June 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I use to create the chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT data=work.MERGETEST noborder;
Title "Test";
VBAR EVENT_DT / RESPONSE=COUNT GROUP=CONTACT;
 yaxis display=(noline noticks) grid values=(0 to 100000 by 1000) offsetmin=0
		label='Count' ;
	inset 'Change started on the 25 June 2018' / position= topright border;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have used the following to change the fill colour in a single bar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Attrmap;
	Retain id "myid";
	input value $ fillcolor $8.;
	datalines;
	0 VIBG
	1 BIBG
	;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and use&amp;nbsp;dattrmap=attrmap&amp;nbsp; attrid=myid in the SGPLOT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I now change it to colour the stacked bar chart&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 04:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-fill-colours-on-a-stacked-bar-chart-SGPLOT/m-p/473972#M30743</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2018-06-28T04:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change fill colours on a stacked bar chart (SGPLOT)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-fill-colours-on-a-stacked-bar-chart-SGPLOT/m-p/473994#M30745</link>
      <description>&lt;P&gt;Can you not do two plots with overlay?&amp;nbsp; I.e. plot all values &amp;lt; 25jun and give those a style color, then plot all values &amp;gt; 25jun and give those a style color different to the first?&amp;nbsp; That would be the quickest way I can think of.&amp;nbsp; The other way would be to use groups.&amp;nbsp; So in your data assign &amp;lt; 25jun as group1, &amp;gt; 25jun as group 2, then use the group= options in the plot.&amp;nbsp; The best reference for graphing is here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And please avoid coding all in uppercase, it really makes code hard to read.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 08:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-fill-colours-on-a-stacked-bar-chart-SGPLOT/m-p/473994#M30745</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-28T08:17:03Z</dc:date>
    </item>
  </channel>
</rss>

