<?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 Assigning colors to bar graph using styleattrs in proc sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-to-bar-graph-using-styleattrs-in-proc-sgplot/m-p/771422#M22059</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am making a simple bar graph (2 bars) and I would like each bar to be a different color. Below is the code I used to make the data set and the graph.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;      
	length cPLTL $9 ;  
	input percent cPLTL @@;      
cards;      
2.19 cPLTL      
17.03 non-cPLTL       
;          
proc print data=new; run;    
   
proc sgplot data=new;        
	styleattrs datacolors=(cx66FF66 cxFF6666); 
	vbar cPLTL / response=percent groupdisplay=cluster barwidth=.4; 
	yaxis label="Percent of unsuccessful students";       
	xaxis display=(nolabel);              
	run;     &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My issue is that the styleattrs command is not working. Can someone please show me what I am doing wrong? I would like to use the color naming system values to specify navy blue and bright orange, but I am aware that the colors in the code above don't specify that. I would also be open to learning a simpler way of assigning colors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 16:47:18 GMT</pubDate>
    <dc:creator>mcmaxwell</dc:creator>
    <dc:date>2021-09-30T16:47:18Z</dc:date>
    <item>
      <title>Assigning colors to bar graph using styleattrs in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-to-bar-graph-using-styleattrs-in-proc-sgplot/m-p/771422#M22059</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am making a simple bar graph (2 bars) and I would like each bar to be a different color. Below is the code I used to make the data set and the graph.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;      
	length cPLTL $9 ;  
	input percent cPLTL @@;      
cards;      
2.19 cPLTL      
17.03 non-cPLTL       
;          
proc print data=new; run;    
   
proc sgplot data=new;        
	styleattrs datacolors=(cx66FF66 cxFF6666); 
	vbar cPLTL / response=percent groupdisplay=cluster barwidth=.4; 
	yaxis label="Percent of unsuccessful students";       
	xaxis display=(nolabel);              
	run;     &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My issue is that the styleattrs command is not working. Can someone please show me what I am doing wrong? I would like to use the color naming system values to specify navy blue and bright orange, but I am aware that the colors in the code above don't specify that. I would also be open to learning a simpler way of assigning colors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 16:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-to-bar-graph-using-styleattrs-in-proc-sgplot/m-p/771422#M22059</guid>
      <dc:creator>mcmaxwell</dc:creator>
      <dc:date>2021-09-30T16:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning colors to bar graph using styleattrs in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-to-bar-graph-using-styleattrs-in-proc-sgplot/m-p/771427#M22060</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/347487"&gt;@mcmaxwell&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am making a simple bar graph (2 bars) and I would like each bar to be a different color. Below is the code I used to make the data set and the graph.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;      
	length cPLTL $9 ;  
	input percent cPLTL @@;      
cards;      
2.19 cPLTL      
17.03 non-cPLTL       
;          
proc print data=new; run;    
   
proc sgplot data=new;        
	styleattrs datacolors=(cx66FF66 cxFF6666); 
	vbar cPLTL / response=percent groupdisplay=cluster barwidth=.4; 
	yaxis label="Percent of unsuccessful students";       
	xaxis display=(nolabel);              
	run;     &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My issue is that the styleattrs command is not working. Can someone please show me what I am doing wrong? I would like to use the color naming system values to specify navy blue and bright orange, but I am aware that the colors in the code above don't specify that. I would also be open to learning a simpler way of assigning colors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;GROUPDISPLAY without a GROUP variable is hint as to what is not happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add GROUP= cPLTL to the VBAR options to make each bar with a different color.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Had nothing to do with the STYLEATTRS but missing group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-to-bar-graph-using-styleattrs-in-proc-sgplot/m-p/771427#M22060</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-30T17:00:58Z</dc:date>
    </item>
  </channel>
</rss>

