<?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: Need assistance replicating a bar chart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370673#M12807</link>
    <description>&lt;P&gt;You were on the right track - you just needed to fine-tune it with a few more options ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data chart4;&lt;BR /&gt;input year $9. FCPIXG FMIXG FOIXG FOEXG;&lt;BR /&gt;datalines;&lt;BR /&gt;1987-2015 16.5 6.9 2.7 2.3&lt;BR /&gt;1987-1990 18.7 5.7 2.6 1.3&lt;BR /&gt;1990-1995 15.8 5.2 3.7 2.1&lt;BR /&gt;1995-2000 40.7 10.9 3.4 4.5&lt;BR /&gt;2000-2007 13.7 8.5 2.6 2.7&lt;BR /&gt;2007-2015 5.4 4.6 1.6 1.2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt; &lt;BR /&gt;proc sort data=chart4 out=yo;&lt;BR /&gt;by year; run;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;proc transpose data=yo out=chrto;&lt;BR /&gt;by year;&lt;BR /&gt;var FCPIXG FMIXG FOIXG FOEXG;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;axis1 label=none value=none;&lt;BR /&gt;axis2 label=none value=(angle=45) offset=(3,3);&lt;BR /&gt;axis3 label=none order=(0 to 45 by 4) major=none minor=none;&lt;BR /&gt;legend1 label=none across=1 shape=bar(.15in,.15in);&lt;BR /&gt;pattern1 v=s c=cx4f81be;&lt;BR /&gt;pattern2 v=s c=cxc5daef;&lt;BR /&gt;pattern3 v=s c=cx1f487c;&lt;BR /&gt;pattern4 v=s c=cx8cb4e5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 j=l h=3pct 'Chart 4. Types of capital equipment in the';&lt;BR /&gt;title2 j=l h=3pct 'private nonfarm business sector, 1987- 20XX ';&lt;BR /&gt;title3 ' ';&lt;BR /&gt;title4 j=l move=(+4,+0) 'Average annual growth rates';&lt;BR /&gt;proc gchart data=chrto; &lt;BR /&gt; vbar _NAME_ / subgroup=_name_&lt;BR /&gt;noframe sumvar=col1 group=year &lt;BR /&gt;legend = legend1&lt;BR /&gt;maxis=axis1 gaxis=axis2 raxis=axis3 space=0&lt;BR /&gt;legend=legend1&lt;BR /&gt;autoref clipref cref=graydd&lt;BR /&gt;coutline=gray55;&lt;BR /&gt;run ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9873i4F506D841E5E8747/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="bar_grouped.png" title="bar_grouped.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 17:31:25 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2017-06-26T17:31:25Z</dc:date>
    <item>
      <title>Need assistance replicating a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370173#M12796</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to ask for some help with graphs. Specifically bar charts. I am trying to replicate a chart that is normally done in excel. I have made some efforts using PROC GCHART but I did not come close, only in shape of the bar chart and grouping.&lt;/P&gt;&lt;P&gt;The image I am trying to replicate is attached and is called ORGINAL1.jpg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the table I am using&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; chartexample;&lt;/P&gt;&lt;P&gt;input year $9. FCPIXG FMIXG FOIXG FOEXG;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1987-2015 16.5 6.9 2.7 2.3&lt;/P&gt;&lt;P&gt;1987-1990 18.7 5.7 2.6 1.3&lt;/P&gt;&lt;P&gt;1990-1995 15.8 5.2 3.7 2.1&lt;/P&gt;&lt;P&gt;1995-2000 40.7 10.9 3.4 4.5&lt;/P&gt;&lt;P&gt;2000-2007 13.7 8.5 2.6 2.7&lt;/P&gt;&lt;P&gt;2007-2015 5.4 4.6 1.6 1.2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I used to attempt the replication.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data=chart4 out=yo;&lt;/P&gt;&lt;P&gt;by year; &lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;transpose&lt;/STRONG&gt; data=yo out=chrto;&lt;/P&gt;&lt;P&gt;by year;&lt;/P&gt;&lt;P&gt;var FCPIXG FMIXG FOIXG FOEXG;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;title 'Chart 4. Types of capital equipment in the private nonfarm business sector, 1987- 20XX ';&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;gchart&lt;/STRONG&gt; data=chrto;&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;&amp;nbsp; vbar _NAME_ / noframe sumvar=col1 group=year&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;&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;legend = legend1&lt;/P&gt;&lt;P&gt;coutline=same ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt; ;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output graph is attached and is called IMAGE1.jpg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance (links, websites) would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13980iF1D16FD22FD6DF27/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMAGE1.jpg" title="IMAGE1.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13981i29986BF3567F63C2/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="ORGINAL1.JPG" title="ORGINAL1.JPG" /&gt;</description>
      <pubDate>Fri, 23 Jun 2017 21:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370173#M12796</guid>
      <dc:creator>yo1</dc:creator>
      <dc:date>2017-06-23T21:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance replicating a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370602#M12800</link>
      <description>&lt;P&gt;I'm not clear on which elements you are looking to replicate and how exactly you want to replicate them, but the SGPLOT below gets you the general type of graph you want. Also, I did not know how to map your variables to the descriptions, so you'll want to make sure that's correct. Otherwise, take a look and then see what elements need to be fixed. If you cannot figure out how to fix them, I'll be happy to see if I know how.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data chartexample;
input year $9. FCPIXG FMIXG FOIXG FOEXG;
datalines;
1987-2015 16.5 6.9 2.7 2.3
1987-1990 18.7 5.7 2.6 1.3
1990-1995 15.8 5.2 3.7 2.1
1995-2000 40.7 10.9 3.4 4.5
2000-2007 13.7 8.5 2.6 2.7
2007-2015 5.4 4.6 1.6 1.2
;

proc sort data=chartexample out = chartexample2;
    by year; 
run;

proc transpose data=chartexample2 out=chartexample3(rename=(_name_ = eqType)) ;
    by year;
    var FCPIXG FMIXG FOIXG FOEXG;
run;

proc format;
    value $eq
    'FCPIXG' = 'Computers &amp;amp; related...'
    'FMIXG' = 'Communication...'
    'FOIXG' = 'Other information...'
    'FOEXG' = 'All other...';
run;

proc sgplot data = chartexample3 noautolegend;
    title 'Chart 4. Types of capital equipment in the private nonfarm business sector, 1987- 20XX ';
    format eqType $eq.;
    vbar year / group = eqType response = col1 groupdisplay = cluster name = 'yr';
    xaxis display=(nolabel);
    yaxis display=(nolabel);
    keylegend 'yr' / noborder across = 1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jun 2017 14:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370602#M12800</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-06-26T14:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance replicating a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370673#M12807</link>
      <description>&lt;P&gt;You were on the right track - you just needed to fine-tune it with a few more options ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data chart4;&lt;BR /&gt;input year $9. FCPIXG FMIXG FOIXG FOEXG;&lt;BR /&gt;datalines;&lt;BR /&gt;1987-2015 16.5 6.9 2.7 2.3&lt;BR /&gt;1987-1990 18.7 5.7 2.6 1.3&lt;BR /&gt;1990-1995 15.8 5.2 3.7 2.1&lt;BR /&gt;1995-2000 40.7 10.9 3.4 4.5&lt;BR /&gt;2000-2007 13.7 8.5 2.6 2.7&lt;BR /&gt;2007-2015 5.4 4.6 1.6 1.2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt; &lt;BR /&gt;proc sort data=chart4 out=yo;&lt;BR /&gt;by year; run;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;proc transpose data=yo out=chrto;&lt;BR /&gt;by year;&lt;BR /&gt;var FCPIXG FMIXG FOIXG FOEXG;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;axis1 label=none value=none;&lt;BR /&gt;axis2 label=none value=(angle=45) offset=(3,3);&lt;BR /&gt;axis3 label=none order=(0 to 45 by 4) major=none minor=none;&lt;BR /&gt;legend1 label=none across=1 shape=bar(.15in,.15in);&lt;BR /&gt;pattern1 v=s c=cx4f81be;&lt;BR /&gt;pattern2 v=s c=cxc5daef;&lt;BR /&gt;pattern3 v=s c=cx1f487c;&lt;BR /&gt;pattern4 v=s c=cx8cb4e5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 j=l h=3pct 'Chart 4. Types of capital equipment in the';&lt;BR /&gt;title2 j=l h=3pct 'private nonfarm business sector, 1987- 20XX ';&lt;BR /&gt;title3 ' ';&lt;BR /&gt;title4 j=l move=(+4,+0) 'Average annual growth rates';&lt;BR /&gt;proc gchart data=chrto; &lt;BR /&gt; vbar _NAME_ / subgroup=_name_&lt;BR /&gt;noframe sumvar=col1 group=year &lt;BR /&gt;legend = legend1&lt;BR /&gt;maxis=axis1 gaxis=axis2 raxis=axis3 space=0&lt;BR /&gt;legend=legend1&lt;BR /&gt;autoref clipref cref=graydd&lt;BR /&gt;coutline=gray55;&lt;BR /&gt;run ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9873i4F506D841E5E8747/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="bar_grouped.png" title="bar_grouped.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 17:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/370673#M12807</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2017-06-26T17:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance replicating a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/371347#M12833</link>
      <description>Hi collinelliot,&lt;BR /&gt;&lt;BR /&gt;Thank you for responding. Your code produced the answer I was looking for. I haven’t had much experience with SGPLOT but seeing the output generated is enough for me to start exploring. I need to do some additional formatting, (add the gridlines) but that shouldn’t be too much.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jun 2017 15:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/371347#M12833</guid>
      <dc:creator>yo1</dc:creator>
      <dc:date>2017-06-28T15:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance replicating a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/371349#M12834</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for responding. Your code produced the answer I was looking for.&amp;nbsp;&amp;nbsp; I am actually a big fan of yours when it comes to creating geospatial heat maps. I usually go to your site(&lt;A href="http://robslink.com/SAS/Home.htm" target="_blank"&gt;http://robslink.com/SAS/Home.htm&lt;/A&gt;) often for clues for the next great visualization project in SAS…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 15:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-assistance-replicating-a-bar-chart/m-p/371349#M12834</guid>
      <dc:creator>yo1</dc:creator>
      <dc:date>2017-06-28T15:30:56Z</dc:date>
    </item>
  </channel>
</rss>

