<?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 gbarline legend in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65505#M2230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if there's a more elegant way to get the legend you want, but you can make it look a little better by tweaking the 'shape' values a little, such as ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 v=dot i=join c=blue h=1 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options nocenter;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;legend1; legend2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend1 noframe label=('' ) across=4 down=1&lt;BR /&gt;&amp;nbsp; position=(bottom center outside)&lt;BR /&gt;&amp;nbsp; origin=(10 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('Cheetara' 'Panthro' 'Tygra' ' ')&lt;BR /&gt;&amp;nbsp; shape=bar(.15in,.15in)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend2 noframe label=('' )&amp;nbsp; across=1 down=1&lt;BR /&gt;&amp;nbsp; position=(bottom center outside)&lt;BR /&gt;&amp;nbsp; origin=(51 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('YVar')&lt;BR /&gt;&amp;nbsp; shape=symbol(7,1.5)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis2 origin=(, 20 pct);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gbarline data=sample;&lt;BR /&gt;bar xvar / discrete sumvar=yvar1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=cats maxis=axis2 legend=legend1;&lt;BR /&gt;plot / sumvar=yvar2 legend=legend2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Oct 2011 13:23:36 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2011-10-04T13:23:36Z</dc:date>
    <item>
      <title>gbarline legend</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65502#M2227</link>
      <description>hi experts,&lt;BR /&gt;
&lt;BR /&gt;
is it possible for me to put the legend of the bar and the plot on a single frame without using an annotate dataset? &lt;BR /&gt;
&lt;BR /&gt;
thanks!&lt;BR /&gt;
milton</description>
      <pubDate>Mon, 24 Jan 2011 16:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65502#M2227</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2011-01-24T16:48:30Z</dc:date>
    </item>
    <item>
      <title>gbarline legend</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65503#M2228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code creates a combined legend, containing both the bar &amp;amp; line, when I tried it in v9.2 and v9.2m3.&lt;/P&gt;&lt;P&gt;(I'm not 100% sure - is this what you're asking to do?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;BR /&gt;do cats='Cheetara','Panthro','Tygra';&lt;BR /&gt;do xvar=1 to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; yvar1=ranuni(123)*1000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; yvar2=ranuni(123)*100;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 v=dot i=join c=blue;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend1; legend2;&lt;/P&gt;&lt;P&gt;legend1 frame label=('bar');&lt;BR /&gt;legend2 frame label=('plot');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gbarline data=sample;&lt;BR /&gt; bar xvar / discrete sumvar=yvar1 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=cats legend=legend1;&lt;BR /&gt; plot / sumvar=yvar2 legend=legend2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 17:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65503#M2228</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2011-07-01T17:48:12Z</dc:date>
    </item>
    <item>
      <title>gbarline legend</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65504#M2229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my effort to get one unified legend, that is, to get all of the variables in one line across the bottom, I modified Rob's code above. It's not an elegant solution. I am open to suggestions for a better way to do this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data sample;&lt;BR /&gt;do cats='Cheetara','Panthro','Tygra';&lt;BR /&gt;do xvar=1 to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; yvar1=ranuni(123)*1000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; yvar2=ranuni(123)*100;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;symbol1 v=dot i=join c=blue h=1 ;&lt;/P&gt;&lt;P&gt;options nocenter; &lt;BR /&gt;legend1; legend2;&lt;/P&gt;&lt;P&gt;legend1 noframe label=('' ) across=4 down=1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; position=(bottom center outside) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; origin=(10 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('Cheetara' 'Panthro' 'Tygra' ' ')&lt;BR /&gt;&amp;nbsp; shape=bar(.9,1)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;/P&gt;&lt;P&gt;legend2 noframe label=('' )&amp;nbsp; across=1 down=1&lt;BR /&gt; position=(bottom center outside) &lt;BR /&gt;&amp;nbsp; origin=(51 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('YVar')&lt;BR /&gt;&amp;nbsp; shape=symbol(1.2,1)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;BR /&gt; &lt;BR /&gt;axis2 origin=(, 20 pct);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;proc gbarline data=sample;&lt;BR /&gt;bar xvar / discrete sumvar=yvar1 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=cats maxis=axis2 legend=legend1;&lt;BR /&gt;plot / sumvar=yvar2 legend=legend2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65504#M2229</guid>
      <dc:creator>J_Scott</dc:creator>
      <dc:date>2011-10-03T18:29:59Z</dc:date>
    </item>
    <item>
      <title>gbarline legend</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65505#M2230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if there's a more elegant way to get the legend you want, but you can make it look a little better by tweaking the 'shape' values a little, such as ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 v=dot i=join c=blue h=1 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options nocenter;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;legend1; legend2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend1 noframe label=('' ) across=4 down=1&lt;BR /&gt;&amp;nbsp; position=(bottom center outside)&lt;BR /&gt;&amp;nbsp; origin=(10 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('Cheetara' 'Panthro' 'Tygra' ' ')&lt;BR /&gt;&amp;nbsp; shape=bar(.15in,.15in)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend2 noframe label=('' )&amp;nbsp; across=1 down=1&lt;BR /&gt;&amp;nbsp; position=(bottom center outside)&lt;BR /&gt;&amp;nbsp; origin=(51 pct ,1 pct)&lt;BR /&gt;&amp;nbsp; value=('YVar')&lt;BR /&gt;&amp;nbsp; shape=symbol(7,1.5)&lt;BR /&gt;&amp;nbsp; mode=share;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis2 origin=(, 20 pct);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gbarline data=sample;&lt;BR /&gt;bar xvar / discrete sumvar=yvar1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=cats maxis=axis2 legend=legend1;&lt;BR /&gt;plot / sumvar=yvar2 legend=legend2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 13:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65505#M2230</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2011-10-04T13:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: gbarline legend</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65506#M2231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using SAS 9.2 or later, you can use GTL to create this graph.&amp;nbsp; GTL Code and output attached.&amp;nbsp; &lt;/P&gt;&lt;P&gt;If you are using SAS 9.3, you can use the simpler SGPLOT procedures too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="1205" alt="BarLineLegendGTL.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/1205_BarLineLegendGTL.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;V9.2 GTL code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;/*--Summarize the data for the series overlay--*/
proc means data=sample nway;
&amp;nbsp; class&amp;nbsp; xvar;
&amp;nbsp; output out= sampleSum sum(yvar2) = Yvar;
&amp;nbsp; run;
&lt;BR /&gt;/*--Merge summarized column with original data--*/
data sample2;
&amp;nbsp; merge sample (rename=(xvar=xvar1)) samplesum(keep=xvar Yvar);
&amp;nbsp; run;

/*--Bar line template--*/
proc template;
&amp;nbsp; define statgraph barlinelegend;
&amp;nbsp;&amp;nbsp;&amp;nbsp; begingraph;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay / yaxisopts=(offsetmin=0 label='Yvar1 (Sum)' linearopts=(viewmin=0))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y2axisopts=(offsetmin=0 label='Yvar2 (Sum)' linearopts=(viewmin=0));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; barchart x=xvar1 y=yvar1 / group=cats name='bar';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seriesplot x=xvar y=yvar / name='line' yaxis=y2 legendlabel='Yvar2'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; display=(markers) markerattrs=graphdata1(symbol=circlefilled size=11)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lineattrs=graphdata1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; discretelegend 'bar' 'line';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endgraph;
&amp;nbsp; end;
run;
&lt;BR /&gt;/*--Render the graph--*/
ods listing;
ods graphics / reset width=6in height=3in imagename='BarLineLegendGTL';
proc sgrender data=sample2 template=barlinelegend;
&amp;nbsp; label xvar1='xvar';
run;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 19:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gbarline-legend/m-p/65506#M2231</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-10-05T19:02:05Z</dc:date>
    </item>
  </channel>
</rss>

