<?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: Colorize individual lines in gannt like plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Colorize-individual-lines-in-gannt-like-plot/m-p/595004#M18951</link>
    <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=have noautolegend;
    highlow y=id low=start_dt high=end_dt/
        lineattrs=(thickness=6pt) colorresponse=Amount colormodel=(green gold red);
    gradlegend / position=right;
    yaxis grid reverse; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Udklip.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33023i4F8F903BD54D6840/image-size/large?v=v2&amp;amp;px=999" role="button" title="Udklip.PNG" alt="Udklip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 10:26:09 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-10-09T10:26:09Z</dc:date>
    <item>
      <title>Colorize individual lines in gannt like plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Colorize-individual-lines-in-gannt-like-plot/m-p/594986#M18950</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my gannt chart lines to have a color corresponding to the amount variable, akin to microsoft excel's conditional formatting. I want higher values to be red, average to be yellow and low values to be green, preferrably with gradings in between. Is there a way to colorize each line automatically based on the amount value? My real data contains hundreds of cases, so I dont want a hardcoded sollution.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gannt.PNG" style="width: 570px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33022i9B496C22BB85B463/image-size/large?v=v2&amp;amp;px=999" role="button" title="gannt.PNG" alt="gannt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA have;
 INPUT id $ amount start_dt end_dt ;
CARDS;
1 5000 21000 21030
2 30000 20870 20999
3 200 20951 21000
4 10000 20942 20987
5 500 20820 20900
;

RUN; 

data have ;
set have ;
format start_dt end_dt date9.;
run;

ods graphics on ;

proc sgplot data=have noautolegend;
highlow y=id low=start_dt high=end_dt/
         lineattrs=(thickness=6pt);
yaxis grid reverse ; 
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 09:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Colorize-individual-lines-in-gannt-like-plot/m-p/594986#M18950</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-10-09T09:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Colorize individual lines in gannt like plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Colorize-individual-lines-in-gannt-like-plot/m-p/595004#M18951</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=have noautolegend;
    highlow y=id low=start_dt high=end_dt/
        lineattrs=(thickness=6pt) colorresponse=Amount colormodel=(green gold red);
    gradlegend / position=right;
    yaxis grid reverse; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Udklip.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33023i4F8F903BD54D6840/image-size/large?v=v2&amp;amp;px=999" role="button" title="Udklip.PNG" alt="Udklip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 10:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Colorize-individual-lines-in-gannt-like-plot/m-p/595004#M18951</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-09T10:26:09Z</dc:date>
    </item>
  </channel>
</rss>

