<?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: Blockplot on y-axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273560#M9766</link>
    <description>&lt;P&gt;Hi Kriss,&lt;/P&gt;
&lt;P&gt;how it's going? I think that the bandplot could not be used with a axis different to the X.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that is not the best way, but could you pas the X-axis to numeric, and after that rename the axis with discrete ticklist and use something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;
define statgraph sgplot_blockplot;
begingraph /;
layout overlay / xaxisopts=( Label="Number of Patients with Related Treatment Emergent Adverse Events" ) yaxisopts=( TickValueAttrs=( Size=5)  );
	
   BarChartParm X=order Y=Age /  orient=horizontal Group=Sex LegendLabel="Age" NAME="leg" groupdisplay=cluster grouporder=ascending;
	 bandplot y=order limitupper=top
          limitlower=down /group=SEX DATATRANSPARENCY=0.6 DISCRETEOFFSET=0.5; ;
   DiscreteLegend "leg" / Location=Outside down=1 order=columnMajor;
endlayout;
endgraph;
end;
run;

proc sort data=sashelp.class out=class;
by sex name;
run;

data Class;
	set Class;
	order=_N_;
	top=20;
	down=0;
run;

proc sgrender data=class template=sgplot_blockplot;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12592i91519D4055D10E9E/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Test.png" title="Test.png" /&gt;</description>
    <pubDate>Fri, 27 May 2016 11:19:01 GMT</pubDate>
    <dc:creator>arodriguez</dc:creator>
    <dc:date>2016-05-27T11:19:01Z</dc:date>
    <item>
      <title>Blockplot on y-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273541#M9764</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a graph that shows the number of adverse events and the severity of the event for a few terms. The terms are split by System Organ Class which is denoted by the bands. I would like to be able to use hbarparm instead of vbarparm, and therefore would like to use the blockplot on the y-axis, however so far I can only make the blockplot work with the x-axis. My main aim is to be able for someone to tell which system organ class the adverse events are related too, and so I thought an easy way to do this was to shade the background.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached below is my image. Essentially, I'd like to rotate the image 90 degrees. Have you got any ideas please?&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/3364i331B6023C21E2A2C/image-size/original?v=v2&amp;amp;px=-1" alt="blockplot background.png" title="blockplot background.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the SAS code I have used so far, altough, there is no data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data = count_max4 dattrmap=myattrmap;
  block x = AECTC block = aesoc / filltype=alternate novalues;
  vbarparm response = count_ae category = AECTC / group = max_aetoxgrn groupdisplay = stack grouporder=ascending attrid = myid name = "leg";
  keylegend "leg" / down = 1;
  xaxis /*values = (0 to 8 by 1)*/ type = discrete label = "Number of Patients with Related Treatment Emergent Adverse Events";
  yaxis valueattrs = (size = 5);
  format group grp.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kriss&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 09:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273541#M9764</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-05-27T09:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Blockplot on y-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273560#M9766</link>
      <description>&lt;P&gt;Hi Kriss,&lt;/P&gt;
&lt;P&gt;how it's going? I think that the bandplot could not be used with a axis different to the X.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that is not the best way, but could you pas the X-axis to numeric, and after that rename the axis with discrete ticklist and use something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;
define statgraph sgplot_blockplot;
begingraph /;
layout overlay / xaxisopts=( Label="Number of Patients with Related Treatment Emergent Adverse Events" ) yaxisopts=( TickValueAttrs=( Size=5)  );
	
   BarChartParm X=order Y=Age /  orient=horizontal Group=Sex LegendLabel="Age" NAME="leg" groupdisplay=cluster grouporder=ascending;
	 bandplot y=order limitupper=top
          limitlower=down /group=SEX DATATRANSPARENCY=0.6 DISCRETEOFFSET=0.5; ;
   DiscreteLegend "leg" / Location=Outside down=1 order=columnMajor;
endlayout;
endgraph;
end;
run;

proc sort data=sashelp.class out=class;
by sex name;
run;

data Class;
	set Class;
	order=_N_;
	top=20;
	down=0;
run;

proc sgrender data=class template=sgplot_blockplot;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12592i91519D4055D10E9E/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Test.png" title="Test.png" /&gt;</description>
      <pubDate>Fri, 27 May 2016 11:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273560#M9766</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2016-05-27T11:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Blockplot on y-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273575#M9768</link>
      <description>&lt;P&gt;Hi Antonio,&lt;/P&gt;&lt;P&gt;Yes it's good thanks, I hope you're well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this solution, I was thinking of the band plot too, but knew it worked with numeric values. This is a great workaround! Nice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kriss&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 12:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273575#M9768</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-05-27T12:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Blockplot on y-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273586#M9769</link>
      <description>&lt;P&gt;Antonio has proposed a good solution. If you wan to cover the edge bar widths, then another way is to use reference lines for each set of bars. &amp;nbsp;In this case only one set is needed. &amp;nbsp;But this could be extended for multiple sets using alternate colors or different colors like a BLOCKPLOT. &amp;nbsp;Names can be shown using YAXISTABLE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=sashelp.class out=class;&lt;BR /&gt;by sex name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Class;&lt;BR /&gt; set Class;&lt;BR /&gt; id=_n_;&lt;BR /&gt; if sex="M" then refid=id;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=class;&lt;BR /&gt; refline refid / lineattrs=(thickness=16) transparency=0.5;&lt;BR /&gt; hbarparm category=id response=age / group=sex;&lt;BR /&gt; yaxistable name / position=left location=outside valuejustify=right;&lt;BR /&gt; yaxis display=(novalues noticks nolabel);&lt;BR /&gt; xaxis offsetmin=0;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 14:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273586#M9769</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-05-27T14:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Blockplot on y-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273598#M9771</link>
      <description>&lt;P&gt;Thank you for this Sanjay, this really helps! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 14:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Blockplot-on-y-axis/m-p/273598#M9771</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-05-27T14:50:00Z</dc:date>
    </item>
  </channel>
</rss>

