<?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 change the color in BARCHART in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738837#M21475</link>
    <description>&lt;P&gt;I meant YELLOW....&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOL....&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 10:23:41 GMT</pubDate>
    <dc:creator>Coooooo_Lee</dc:creator>
    <dc:date>2021-05-04T10:23:41Z</dc:date>
    <item>
      <title>How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738836#M21474</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to change the bar color in my GTL temple.&lt;/P&gt;&lt;P&gt;No group in my data, just want to show all bars in a same color, like the RED I specified here....&lt;BR /&gt;However, the bar color always black...&lt;/P&gt;&lt;P&gt;Anyone can help? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
 define statgraph swimmer;
  begingraph / drawspace=datavalue;


  layout lattice / rows=1 columns=3 columnweights=(0.1 0.75 0.15) columngutter=0;

    layout overlay;
      entry textattrs=(color=white size=5) "blank";
    endlayout;

    layout overlay / walldisplay=none

        xaxisopts = (label="xxxxx"
                     labelattrs=(size=7)
                     tickvalueattrs=(size=7)
                     linearopts = (viewmin=0 viewmax=140
                                   tickvaluesequence = (start=0 end=140 increment=1)))


      yaxisopts = (label="xxxxxx"  
                     labelattrs=(size=7)
                     display=(label)
                     linearopts = (viewmin=1 viewmax=215
                                   tickvaluesequence = (start=1 end=215 increment=1)));


      barchart  x=obs y=dur /  orient=horizontal barwidth=0.1 fillattrs=(color=yellow);

        endlayout;

   
      layout overlay;
          entry textattrs=(color=white size=5) "blank";
        endlayout;   
    endlayout;
  endgraph;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 May 2021 10:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738836#M21474</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2021-05-04T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738837#M21475</link>
      <description>&lt;P&gt;I meant YELLOW....&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOL....&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 10:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738837#M21475</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2021-05-04T10:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738885#M21476</link>
      <description>&lt;P&gt;You should always include data for your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lots of issues here, but try these:&lt;BR /&gt;1. You are explicitly setting start=, end=, and increment= options. That will result in either 140 or 215 bars, depending on the orientation. When you plot that many bars on a standard-sized plot, the fill will be small and you will mostly see the black outline of the bars&lt;/P&gt;
&lt;P&gt;2. You set barwidth=0.1, which makes the bars even thinner. Again, this causes the yellow fill to be tiny.&lt;/P&gt;
&lt;P&gt;3. You are setting orient=horizontal, which means that the YAXISOPTS apply to the X variable and the XAXISOPTS apply to the Y variable, which can be confusing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try modifying this code until you get what you need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
 define statgraph swimmer;
  begingraph / drawspace=datavalue;
  layout lattice / rows=1 columns=3 columnweights=(0.1 0.75 0.15) columngutter=0;
    layout overlay;
      entry textattrs=(color=white size=5) "blank";
    endlayout;

    layout overlay / walldisplay=none
        xaxisopts = (label="xxxxx"
                     labelattrs=(size=7)
                     tickvalueattrs=(size=7)
                     linearopts = (viewmin=0 viewmax=140
                                   tickvaluesequence = (start=0 end=140 increment=20)))

      yaxisopts = (label="yyyyy"  
                     labelattrs=(size=7)
                     /*display=(label)*/
                     linearopts = (viewmin=0 viewmax=215
                                   tickvaluesequence = (start=0 end=215 increment=25)));

      barchart  x=obs y=dur / /*orient=horizontal*/ barwidth=1 fillattrs=(color=yellow);
        endlayout;
   
      layout overlay;
          entry textattrs=(color=white size=5) "blank";
        endlayout;   
    endlayout;
  endgraph;
  end;
run;

data A;
input obs dur;
datalines;
20   100
40   127
60   165
80   154
100  121
120   92
140   16
;

proc sgrender data=A template=swimmer;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 12:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738885#M21476</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-05-04T12:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738896#M21477</link>
      <description>&lt;P&gt;Hi Rick，&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First thanks for sharing your idea. please see my replies below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. You are explicitly setting start=, end=, and increment= options. That will result in either 140 or 215 bars, depending on the orientation. When you plot that many bars on a standard-sized plot, the fill will be small and you will mostly see the black outline of the bars&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The number here is based on my data, which is truly what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. You set barwidth=0.1, which makes the bars even thinner. Again, this causes the yellow fill to be tiny.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is also what I want as there are too many bars need to be ploted here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. You are setting orient=horizontal, which means that the YAXISOPTS apply to the X variable and the XAXISOPTS apply to the Y variable, which can be confusing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do need to have a transposed barchart, this is also sepcified on purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to remove the&amp;nbsp;black outline of the bars?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 13:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738896#M21477</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2021-05-04T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738898#M21478</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Is there a way to remove the&amp;nbsp;black outline of the bars?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;barchart x=obs y=dur / &lt;STRONG&gt;display=(fill)&lt;/STRONG&gt; ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you truly want all those bars, then you need to make the plot taller (for orientation=horizontal) or wider (for orientation=vertical).&amp;nbsp; If you want a tall horizontal chart, use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods graphics / width=640px height=1800px;  /* very tall */
proc sgrender data=A template=swimmer;
run;
ods graphics / width=640px height=480px; /* reset to standard dimensions */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 May 2021 13:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738898#M21478</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-05-04T13:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the color in BARCHART</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738921#M21479</link>
      <description>Thanks Rick</description>
      <pubDate>Tue, 04 May 2021 14:44:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-the-color-in-BARCHART/m-p/738921#M21479</guid>
      <dc:creator>Coooooo_Lee</dc:creator>
      <dc:date>2021-05-04T14:44:12Z</dc:date>
    </item>
  </channel>
</rss>

