<?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: How do you change the colors in a clustered bar chart in sgplot? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-change-the-colors-in-a-clustered-bar-chart-in-sgplot/m-p/854541#M337723</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data=WORK.Plot1; 

styleattrs datacolors=(grey lightblue);   /*&amp;lt;-----*/

vbar Month  /  nooutline    /*&amp;lt;-----*/
response = cum_sum 
stat=sum 
group=Year 
DATALABELFITPOLICY=NONE 
datalabel=DL 
datalabelattrs=(size=7px) 
groupdisplay=cluster
barwidth=0.90
GROUPORDER=ASCENDING;

yaxis 
valuesformat=COMMA10. 
display=(nolabel) ;
keylegend / title="";
XAXISTABLE;

xaxis 
values=( &amp;amp;xaxis.)
DISPLAY=(NOLABEL);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1674128693037.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79512i92485DAC6E56B08E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1674128693037.png" alt="Ksharp_0-1674128693037.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 11:46:19 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-01-19T11:46:19Z</dc:date>
    <item>
      <title>How do you change the colors in a clustered bar chart in sgplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-change-the-colors-in-a-clustered-bar-chart-in-sgplot/m-p/854496#M337703</link>
      <description>&lt;P&gt;I'm using EG. I have some code that produces a bar chart:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.plot1;
length Month $20.;
infile datalines delimiter='#';
input Year MOnthNum Month $ S DL cum_sum;
datalines;
2021#1#January#672106#672#672106
2021#2#February#365000#365#1037106
2021#3#March#5155529#5156#6192635.49
2021#4#April#4503598#4504#10696232.99
2021#5#May#3290652#3291#13986884.99
2021#6#June#5223191#5223#19210076.24
2021#7#July#3352705#3353#22562781.24
2021#8#August#2019160#2019#24581941.24
2021#9#September#765000#765#25346941.24
2021#10#October#3376000#3376#28722941.24
2021#11#November#3155655#3156#31878596.24
2022#2#February#4622274#4622#4622274.1
2022#3#March#6871150#6871#11493424.1
2022#4#April#1154663#1155#12648087.1
2022#5#May#2281975#2282#14930062.38
2022#6#June#1734715#1735#16664777.38
2022#7#July#2804008#2804#19468785.13
2022#8#August#3110594#3111#22579379.13
2022#9#September#3767519#3768#26346898.23
2022#10#October#4114789#4115#30461686.95
2022#11#November#1309455#1309#31771141.95
;
run;
data WORK.AxisLabelsOrder;
LENGTH Month $100.;
Input  Month $;
datalines;
January
February
March
April
May
June
July
August
September
October
November
December
;
run;
Proc SQL noprint;
Select "'"||STRIP(Month)||"'" into:xaxis SEPARATED BY ' ' 
FROM WORK.AxisLabelsOrder;
quit;
proc sgplot data=WORK.Plot1; 
vbar Month  /
response = cum_sum 
stat=sum 
group=Year 
DATALABELFITPOLICY=NONE 
datalabel=DL 
datalabelattrs=(size=7px) 
groupdisplay=cluster
barwidth=0.90
GROUPORDER=ASCENDING;

yaxis 
valuesformat=COMMA10. 
display=(nolabel) ;
keylegend / title="";
XAXISTABLE;

xaxis 
values=( &amp;amp;xaxis.)
DISPLAY=(NOLABEL);
run;
&lt;/PRE&gt;
&lt;P&gt;I want to be able to change the bar colors for each group. for instance for 2021 I want to be grey and 2022 I want to be light blue. I can't seem to make this work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 06:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-change-the-colors-in-a-clustered-bar-chart-in-sgplot/m-p/854496#M337703</guid>
      <dc:creator>SASAlex101</dc:creator>
      <dc:date>2023-01-19T06:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you change the colors in a clustered bar chart in sgplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-you-change-the-colors-in-a-clustered-bar-chart-in-sgplot/m-p/854541#M337723</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data=WORK.Plot1; 

styleattrs datacolors=(grey lightblue);   /*&amp;lt;-----*/

vbar Month  /  nooutline    /*&amp;lt;-----*/
response = cum_sum 
stat=sum 
group=Year 
DATALABELFITPOLICY=NONE 
datalabel=DL 
datalabelattrs=(size=7px) 
groupdisplay=cluster
barwidth=0.90
GROUPORDER=ASCENDING;

yaxis 
valuesformat=COMMA10. 
display=(nolabel) ;
keylegend / title="";
XAXISTABLE;

xaxis 
values=( &amp;amp;xaxis.)
DISPLAY=(NOLABEL);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1674128693037.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79512i92485DAC6E56B08E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1674128693037.png" alt="Ksharp_0-1674128693037.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 11:46:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-you-change-the-colors-in-a-clustered-bar-chart-in-sgplot/m-p/854541#M337723</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-19T11:46:19Z</dc:date>
    </item>
  </channel>
</rss>

