<?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: Overlay Vline on Vbar without groups in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525308#M17623</link>
    <description>&lt;P&gt;For this situation, you'll need to use a vbarparm/series combination instead of vbar/vline. You'll need to precompute your data before graphing it. The example below&amp;nbsp;computes the data for each plot, merges the data into one data set, and plots it with SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.prdsale nway;
class product region;
var actual;
output out=bars  sum=;
run;

proc summary data=sashelp.prdsale nway;
class product;
var predict;
output out=line  sum=;
run;

data merged;
merge bars line (rename=(product=product2));
run;
ods listing close;

proc sgplot data=merged;
y2axis min=0;
vbarparm category=product response=actual / group=region;
series x=product2 y=predict / y2axis lineattrs=(thickness=3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 02:14:47 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2019-01-08T02:14:47Z</dc:date>
    <item>
      <title>Overlay Vline on Vbar without groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525298#M17621</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm attempting to create a Vbar chart that has an overlay of a vline on the secondary axis.&amp;nbsp; The problem I run into is that the vbar is broken into sub-groups, while the vline is in main groups.&amp;nbsp; E.g vbar is Product A - Model 1, Product A - Model 2, Product B - Model 1, Product B - Model 2, while vlinen is Product A, Product - B.&amp;nbsp; The graph was created in Excel, but I am trying to automate through SAS.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vbar vline.jpg" style="width: 346px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26082iA96882CD9E636EE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Vbar vline.jpg" alt="Vbar vline.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to approach this?&amp;nbsp; I get an error stating that once a group has been invoked, all further overlays must also invoke the group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 00:28:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525298#M17621</guid>
      <dc:creator>uopsouthpaw</dc:creator>
      <dc:date>2019-01-08T00:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay Vline on Vbar without groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525307#M17622</link>
      <description>&lt;P&gt;For this situation, you'll need to use a vbarparm/series combination instead of vbar/vline. You'll need to precompute your data before graphing it. The example below&amp;nbsp;computes the data for each plot, merges the data into one data set, and plots it with SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.prdsale nway;
class product region;
var actual;
output out=bars  sum=;
run;

proc summary data=sashelp.prdsale nway;
class product;
var predict;
output out=line  sum=;
run;

data merged;
merge bars line (rename=(product=product2));
run;
ods listing close;

proc sgplot data=merged;
y2axis min=0;
vbarparm category=product response=actual / group=region;
series x=product2 y=predict / y2axis lineattrs=(thickness=3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 02:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525307#M17622</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-01-08T02:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay Vline on Vbar without groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525308#M17623</link>
      <description>&lt;P&gt;For this situation, you'll need to use a vbarparm/series combination instead of vbar/vline. You'll need to precompute your data before graphing it. The example below&amp;nbsp;computes the data for each plot, merges the data into one data set, and plots it with SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.prdsale nway;
class product region;
var actual;
output out=bars  sum=;
run;

proc summary data=sashelp.prdsale nway;
class product;
var predict;
output out=line  sum=;
run;

data merged;
merge bars line (rename=(product=product2));
run;
ods listing close;

proc sgplot data=merged;
y2axis min=0;
vbarparm category=product response=actual / group=region;
series x=product2 y=predict / y2axis lineattrs=(thickness=3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 02:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525308#M17623</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-01-08T02:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay Vline on Vbar without groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525787#M17638</link>
      <description>&lt;P&gt;DanH thanks for the response.&amp;nbsp; Works 99% of the way.&amp;nbsp; I have my stacked (by group A) vbars and my series (by group B - 2 subsets) running across the chart, however, there is a third line that appears in the Keylegend ( a phantom 3rd series).&amp;nbsp; I don't see any additonal values in my data set.&amp;nbsp; Ideas on what is causing this?&amp;nbsp; The phantom doesn't show up on your example if I split up the series into groups.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 17:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525787#M17638</guid>
      <dc:creator>uopsouthpaw</dc:creator>
      <dc:date>2019-01-09T17:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay Vline on Vbar without groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525789#M17639</link>
      <description>&lt;P&gt;Cancel that Dan.&amp;nbsp; nomissinggroup takes it out.&amp;nbsp; Again, thanks for the quick response and help.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 17:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Overlay-Vline-on-Vbar-without-groups/m-p/525789#M17639</guid>
      <dc:creator>uopsouthpaw</dc:creator>
      <dc:date>2019-01-09T17:29:09Z</dc:date>
    </item>
  </channel>
</rss>

