<?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: Different colors for bars in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305387#M10740</link>
    <description>&lt;P&gt;Add a group variable that has one value for the "desks" and another for everything else and use the GROUP option on the scatterplot statement to use that variable to display different color (and/or marker)&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2016 14:16:19 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-10-18T14:16:19Z</dc:date>
    <item>
      <title>Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305367#M10738</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to change the color only for one bar (for example just for desks) and keep the same color for all the other ones? Could you please help me ? Thank you very much&amp;nbsp;&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/Drawing-confidence-intervals-in-gplot-using-annotate/td-p/11544" target="_blank"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/Drawing-confidence-intervals-in-gplot-using-annotate/td-p/11544&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data error;
&amp;nbsp; input Product $&amp;nbsp; Revenue Upper Lower;
&amp;nbsp; datalines;
Desks&amp;nbsp; 2000 2200&amp;nbsp; 1800
Chairs 1500 1700&amp;nbsp; 1300
Lamps&amp;nbsp; 1200 1100&amp;nbsp; 1300
;
run;

proc template;
&amp;nbsp; define statgraph errorbars;
&amp;nbsp;&amp;nbsp;&amp;nbsp; begingraph;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entrytitle 'Product Revenue';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay / yaxisopts=(offsetmin=0) xaxisopts=(display=(ticks tickvalues line));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;barchart x=product y=revenue;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scatterplot x=product y=revenue / yerrorupper=upper yerrorlower=lower markerattrs=(size=0);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;
&amp;nbsp;&amp;nbsp;&amp;nbsp; endgraph;
&amp;nbsp; end;
run;

ods listing;
ods graphics / reset width=5in height=3in imagename='Error';
proc sgrender data=error template=errorbars;
run;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class="wp_syntax"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13065i55C7E68853D6F35D/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="example.png" title="example.png" /&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305367#M10738</guid>
      <dc:creator>SoumeyaPierret</dc:creator>
      <dc:date>2016-10-18T13:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305379#M10739</link>
      <description>&lt;P&gt;Well, the two things jump to mind:&lt;/P&gt;
&lt;P&gt;- Use a proc template step to define a styles for the graph, and set the colors for group 1 to be one color, then the other groups to the same color.&lt;/P&gt;
&lt;P&gt;- Use two separate graph statements, one barchart statement for the first group setting the color, then another barchart statement for the rest of the data, setting the color there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305379#M10739</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-18T14:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305387#M10740</link>
      <description>&lt;P&gt;Add a group variable that has one value for the "desks" and another for everything else and use the GROUP option on the scatterplot statement to use that variable to display different color (and/or marker)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305387#M10740</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-18T14:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305405#M10741</link>
      <description>&lt;P&gt;Hey RW9,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very very muuuuuuuuuuuuuuch, it worked !!!!!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305405#M10741</guid>
      <dc:creator>SoumeyaPierret</dc:creator>
      <dc:date>2016-10-18T14:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305406#M10742</link>
      <description>&lt;P&gt;Thanks ballardw &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305406#M10742</guid>
      <dc:creator>SoumeyaPierret</dc:creator>
      <dc:date>2016-10-18T14:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Different colors for bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305547#M10743</link>
      <description>&lt;P&gt;Another approach to consider is using a discrete attrmap and setting the group variable on the barchart to be the same as the category variable. In the attrmap, set the one category value to the desired color and the other values to another color. The benefit of this approach is that it will work regardless of data order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 21:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Different-colors-for-bars/m-p/305547#M10743</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2016-10-18T21:59:42Z</dc:date>
    </item>
  </channel>
</rss>

