<?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 to make a bar chart and assign the bar color based on the height of the bar (a continuous value)? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190112#M7030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sure there is a way using GCHART, but I will let other address that solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With SAS 9.3, you can use the SGPLOT procedure with Discrete Attributes Map to get the result you want.&amp;nbsp; The colors are determined by the value of the group variable, not by its position in the data.&amp;nbsp; This feature is designed for just this situation.&amp;nbsp; The Discrete Attr Map is like a format, where you can specify the colors to be used by the VALUE of the group variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first graph uses Value x Loc and Grp1.&amp;nbsp; The second uses Val x Loc and Grp2.&amp;nbsp; Note, in second case, the missing value of 'A" is removed.&amp;nbsp; The order of the data is different, but the colors are assigned by the value of the group variable.&amp;nbsp; The order of the color swatches in the legend are based on data order of the values, but you can order the legend alphabetically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program attached below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7653" alt="BarAttrMap1_93.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7653_BarAttrMap1_93.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7654" alt="BarAttrMap2_93.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7654_BarAttrMap2_93.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data bar;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length Grp1 Grp2 $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Loc $ Value Val;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if value &amp;lt; 50 then Grp1="&amp;lt;50";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if value &amp;lt; 80 then Grp1="50-80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else Grp1="&amp;gt;80";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if val &amp;lt; 50 then Grp2="&amp;lt;50";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if val &amp;lt; 80 then Grp2="50-80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else Grp2="&amp;gt;80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp; .&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp; 60&amp;nbsp; 85&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp; 55&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length value FillColor LineColor $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="&amp;lt;50"; FillColor='Red'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="50-80"; FillColor='Yellow'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="&amp;gt;80"; FillColor='Green'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=5in height=3in imagename='BarAttrMap1_93';&lt;/P&gt;&lt;P&gt;title 'Value by Location';&lt;/P&gt;&lt;P&gt;proc sgplot data=bar dattrmap=attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar loc / response=value group=grp1 datalabel nostatlabel attrid=A ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 50 / lineattrs=(color=darkred) label='Action Limit' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 80 / lineattrs=(color=darkgreen) label='Goal' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis display=(nolabel);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=5in height=3in imagename='BarAttrMap2_93';&lt;/P&gt;&lt;P&gt;title 'Value by Location';&lt;/P&gt;&lt;P&gt;proc sgplot data=bar(where=(val ne .)) dattrmap=attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar loc / response=val group=grp2 datalabel nostatlabel attrid=A;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 50 / lineattrs=(color=darkred) label='Action Limit' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 80 / lineattrs=(color=darkgreen) label='Goal' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis display=(nolabel);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Oct 2014 04:24:39 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2014-10-18T04:24:39Z</dc:date>
    <item>
      <title>How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190107#M7025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a bar chart and think it should be a really really simple task ( you can do this probably in excel under 2 mins or in JMP under 2 mins) but seems like in SAS it is difficult. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a simple data table which has two columns (vars):&amp;nbsp; Location and Value;&amp;nbsp; Location could be three different values and value is between 0 to 1; I am trying to use PROC GCHART to make a bar chart and the X axis is Location and Y axis is ValueT; in addition, I want to assign the bar chart color based on the ValueT; if valueT &amp;lt; 50, then bar should be red; if&amp;nbsp; 50&amp;lt;= valueT&amp;lt;80, then yellow; and if valueT &amp;gt;= 80, then green, I also create a new variable called barcolor to assign the value as 1 2 3 to represent red yellow green . however, for my data table, sometimes it has values all over 80, some times values are all above 50, then if i use the pattern to assign the color to the bar, there will be a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar Location / discrete sumvar=ValueT&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; sum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=barcolor nolegend&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ref=50 80 cref=(red green)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxis=axis1 raxis=axis2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pattern1 value=solid color=red;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pattern2 value=solid color=yellow;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pattern3 value=solid color=green;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; axis1 label=("Location");&lt;/P&gt;&lt;P&gt;&amp;nbsp; axis2 label=(angle=90 "ValueT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order=(0.3to 1.0 by 0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reflabel=("Action Limit" "Goal"); run; quit;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will not do the job when the data table does not have all three range of values; if you only have valueT below 50 and above 80, then the first one will be red but values over 80 of locations will show yellow (correct values should be Green).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure I can do this in PROC GCHART, if not, are there any easy ways to do this? I searched online and maybe rangeattrmap could do it (need a simple example for my case; have read some examples under SAS docs but not easy to understand). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 20:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190107#M7025</guid>
      <dc:creator>ASU_IE</dc:creator>
      <dc:date>2014-10-17T20:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190108#M7026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of SAS do you have?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 20:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190108#M7026</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2014-10-17T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190109#M7027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I beilieve I have 9.3 or 9.4 ( I am using SAS EG 5.1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 20:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190109#M7027</guid>
      <dc:creator>ASU_IE</dc:creator>
      <dc:date>2014-10-17T20:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190110#M7028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are happy with manual edits, which is what Excel does, go to the graphics catalog where the output&amp;nbsp; resides. If you didn't specify GOUT in Proc Gchart then work.gseg. Find the version you want, right click and select edit. You can can change colors, patterns, add text and a variety of other properties of graphics objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 21:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190110#M7028</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-17T21:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190111#M7029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your advice. The problem is I am gonna schedule the code on the server side so I have to make evereything in the program. And intuitively, I thought this should be a very straight forward question and not sure why the SAS graph is so hard to make it happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 01:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190111#M7029</guid>
      <dc:creator>ASU_IE</dc:creator>
      <dc:date>2014-10-18T01:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190112#M7030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sure there is a way using GCHART, but I will let other address that solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With SAS 9.3, you can use the SGPLOT procedure with Discrete Attributes Map to get the result you want.&amp;nbsp; The colors are determined by the value of the group variable, not by its position in the data.&amp;nbsp; This feature is designed for just this situation.&amp;nbsp; The Discrete Attr Map is like a format, where you can specify the colors to be used by the VALUE of the group variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first graph uses Value x Loc and Grp1.&amp;nbsp; The second uses Val x Loc and Grp2.&amp;nbsp; Note, in second case, the missing value of 'A" is removed.&amp;nbsp; The order of the data is different, but the colors are assigned by the value of the group variable.&amp;nbsp; The order of the color swatches in the legend are based on data order of the values, but you can order the legend alphabetically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program attached below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7653" alt="BarAttrMap1_93.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7653_BarAttrMap1_93.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7654" alt="BarAttrMap2_93.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7654_BarAttrMap2_93.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data bar;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length Grp1 Grp2 $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Loc $ Value Val;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if value &amp;lt; 50 then Grp1="&amp;lt;50";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if value &amp;lt; 80 then Grp1="50-80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else Grp1="&amp;gt;80";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if val &amp;lt; 50 then Grp2="&amp;lt;50";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if val &amp;lt; 80 then Grp2="50-80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else Grp2="&amp;gt;80";&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp; .&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp; 60&amp;nbsp; 85&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp; 55&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length value FillColor LineColor $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="&amp;lt;50"; FillColor='Red'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="50-80"; FillColor='Yellow'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id='A'; Value="&amp;gt;80"; FillColor='Green'; LineColor='Black'; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=5in height=3in imagename='BarAttrMap1_93';&lt;/P&gt;&lt;P&gt;title 'Value by Location';&lt;/P&gt;&lt;P&gt;proc sgplot data=bar dattrmap=attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar loc / response=value group=grp1 datalabel nostatlabel attrid=A ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 50 / lineattrs=(color=darkred) label='Action Limit' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 80 / lineattrs=(color=darkgreen) label='Goal' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis display=(nolabel);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=5in height=3in imagename='BarAttrMap2_93';&lt;/P&gt;&lt;P&gt;title 'Value by Location';&lt;/P&gt;&lt;P&gt;proc sgplot data=bar(where=(val ne .)) dattrmap=attrmap;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar loc / response=val group=grp2 datalabel nostatlabel attrid=A;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 50 / lineattrs=(color=darkred) label='Action Limit' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; refline 80 / lineattrs=(color=darkgreen) label='Goal' labelloc=inside labelpos=min;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis display=(nolabel);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 04:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190112#M7030</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-10-18T04:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190113#M7031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See blog article:&amp;nbsp; &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/10/19/consistent-group-colors-by-value/" title="http://blogs.sas.com/content/graphicallyspeaking/2014/10/19/consistent-group-colors-by-value/"&gt;Consistent Group Colors by Value - Graphically Speaking&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 21:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190113#M7031</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-10-19T21:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190114#M7032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help. I think this is exactly what I am trying to do. I have used SAS for several years but pretty new to the graphic related procs/features. Sometime it is little difficult for me to follow the SAS Support docs about different options etc. For exmple, you can create a Bar chart in proc gchart, or in proc sgplot, or even proc sgrender and I cannot tell in which situations I should use which proc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 02:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190114#M7032</guid>
      <dc:creator>ASU_IE</dc:creator>
      <dc:date>2014-10-20T02:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a bar chart and assign the bar color based on the height of the bar (a continuous value)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190115#M7033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In most cases SGPLOT is your best bet, and can handle 95% of the cases.&amp;nbsp; SGPANEL for class panels.&amp;nbsp; For complex (multi-cell) graphs, use GTL.&amp;nbsp; I suggest you subscribe to the&lt;A href="http://http//blogs.sas.com/content/graphicallyspeaking/"&gt; Graphically Speaking Blog&lt;/A&gt; for new ideas, tips and suggestions every week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 02:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/m-p/190115#M7033</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-10-20T02:41:51Z</dc:date>
    </item>
  </channel>
</rss>

