<?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 Independent y-axes in datapanel? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22872#M623</link>
    <description>My statistician again...&lt;BR /&gt;
&lt;BR /&gt;
She wants the y-axes to be independent so that the bars will be actually show something.  She wants the axes like they are in the lab_values example that is actually in the clinical graphs handout and not the sample code that is out there for that example, because the sample code doesn't have the axis for alkaline phosphatase.&lt;BR /&gt;
&lt;BR /&gt;
The version below has the y-axes the same.&lt;BR /&gt;
&lt;BR /&gt;
Here's her code:&lt;BR /&gt;
&lt;BR /&gt;
Data one;&lt;BR /&gt;
input lab $ armcd mwtmean vari  $ result;&lt;BR /&gt;
cards;&lt;BR /&gt;
														BB         1         1.30    cyto        0.00000&lt;BR /&gt;
                                                        BB         1         1.30    pru         0.00000&lt;BR /&gt;
                                                        BB         1         1.30    flush       0.00000&lt;BR /&gt;
                                                        BB         1         1.30    infusion    0.33333&lt;BR /&gt;
                                                        BB         1         1.30    chills      0.50000&lt;BR /&gt;
                                                        BB         1         1.30    fatigue     0.16667&lt;BR /&gt;
                                                        BB         2         1.62    cyto        0.14286&lt;BR /&gt;
                                                        BB         2         1.62    pru         0.28571&lt;BR /&gt;
                                                        BB         2         1.62    flush       0.14286&lt;BR /&gt;
                                                        BB         2         1.62    infusion    0.28571&lt;BR /&gt;
                                                        BB         2         1.62    chills      0.28571&lt;BR /&gt;
                                                        BB         2         1.62    fatigue     0.14286&lt;BR /&gt;
                                                        BB         3         7.30    cyto        0.14286&lt;BR /&gt;
                                                        BB         3         7.30    pru         0.42857&lt;BR /&gt;
                                                        BB         3         7.30    flush       0.28571&lt;BR /&gt;
                                                        BB         3         7.30    infusion    0.57143&lt;BR /&gt;
                                                        BB         3         7.30    chills      0.28571&lt;BR /&gt;
                                                        BB         3         7.30    fatigue     0.42857&lt;BR /&gt;
                                                        BB         4         7.02    cyto        0.25000&lt;BR /&gt;
                                                        BB         4         7.02    pru         0.50000&lt;BR /&gt;
                                                        BB         4         7.02    flush       0.25000&lt;BR /&gt;
                                                        BB         4         7.02    infusion    0.75000&lt;BR /&gt;
                                                        BB         4         7.02    chills      0.87500&lt;BR /&gt;
                                                        BB         4         7.02    fatigue     0.37500&lt;BR /&gt;
                                                        BB         5        10.59    cyto        0.15385&lt;BR /&gt;
                                                        BB         5        10.59    pru         0.38462&lt;BR /&gt;
                                                        BB         5        10.59    flush       0.38462&lt;BR /&gt;
                                                        BB         5        10.59    infusion    0.69231&lt;BR /&gt;
                                                        BB         5        10.59    chills      0.69231&lt;BR /&gt;
                                                        BB         5        10.59    fatigue     0.61538&lt;BR /&gt;
                                                        BB         6         3.71    cyto        0.16667&lt;BR /&gt;
                                                        BB         6         3.71    pru         0.50000&lt;BR /&gt;
                                                        BB         6         3.71    flush       0.33333&lt;BR /&gt;
                                                        BB         6         3.71    infusion    0.83333&lt;BR /&gt;
                                                        BB         6         3.71    chills      0.83333&lt;BR /&gt;
                                                        BB         6         3.71    fatigue     0.83333&lt;BR /&gt;
                                                        BB         7         5.90    cyto        0.33333&lt;BR /&gt;
                                                        BB         7         5.90    pru         0.16667&lt;BR /&gt;
                                                        BB         7         5.90    flush       0.33333&lt;BR /&gt;
                                                        BB         7         5.90    infusion    0.66667&lt;BR /&gt;
                                                        BB         7         5.90    chills      0.66667&lt;BR /&gt;
                                                        BB         7         5.90    fatigue     1.00000&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ODS path (prepend) work.tempgrap;&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
  define statgraph aepanel/store=work.tempgrap;&lt;BR /&gt;
     begingraph/designwidth=10in designheight=4.5in;&lt;BR /&gt;
      layout gridded / rowgutter=0.5;&lt;BR /&gt;
        layout datapanel classvars=(vari) / columnaxisopts=(tickvalueattrs=(size=5)) &lt;BR /&gt;
                                            columns=2 rows=3 headerlabeldisplay=value&lt;BR /&gt;
		rowaxisopts=(griddisplay=on &lt;BR /&gt;
         display=(ticks tickvalues) linearopts=(viewmax=1 tickvaluepriority=true &lt;BR /&gt;
             						tickvaluesequence=(start=0 end=12 increment=1)) &lt;BR /&gt;
         							displaysecondary=(ticks tickvalues) &lt;BR /&gt;
							         altdisplaysecondary=(ticks tickvalues) &lt;BR /&gt;
									altdisplay=(ticks tickvalues)) ;&lt;BR /&gt;
		layout prototype /  cycleattrs=true;&lt;BR /&gt;
            seriesplot x=armcd y=mwtmean /yaxis=y2 display=(markers) &lt;BR /&gt;
                                       markerattrs=(size=9px weight=bold)&lt;BR /&gt;
                                       lineattrs=(thickness=2px)  name="series1";&lt;BR /&gt;
		   barchart x=armcd y=result/ primary=true  skin=modern outlineattrs=(color=black) name="series2";&lt;BR /&gt;
          endlayout;&lt;BR /&gt;
        endlayout;&lt;BR /&gt;
        discretelegend "series1" "series2";&lt;BR /&gt;
      endlayout;&lt;BR /&gt;
    endgraph;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods rtf file='test.rtf';&lt;BR /&gt;
&lt;BR /&gt;
proc sgrender data=one template=aepanel;  &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods rtf close;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
    <pubDate>Fri, 14 May 2010 21:17:44 GMT</pubDate>
    <dc:creator>SusanParker</dc:creator>
    <dc:date>2010-05-14T21:17:44Z</dc:date>
    <item>
      <title>Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22872#M623</link>
      <description>My statistician again...&lt;BR /&gt;
&lt;BR /&gt;
She wants the y-axes to be independent so that the bars will be actually show something.  She wants the axes like they are in the lab_values example that is actually in the clinical graphs handout and not the sample code that is out there for that example, because the sample code doesn't have the axis for alkaline phosphatase.&lt;BR /&gt;
&lt;BR /&gt;
The version below has the y-axes the same.&lt;BR /&gt;
&lt;BR /&gt;
Here's her code:&lt;BR /&gt;
&lt;BR /&gt;
Data one;&lt;BR /&gt;
input lab $ armcd mwtmean vari  $ result;&lt;BR /&gt;
cards;&lt;BR /&gt;
														BB         1         1.30    cyto        0.00000&lt;BR /&gt;
                                                        BB         1         1.30    pru         0.00000&lt;BR /&gt;
                                                        BB         1         1.30    flush       0.00000&lt;BR /&gt;
                                                        BB         1         1.30    infusion    0.33333&lt;BR /&gt;
                                                        BB         1         1.30    chills      0.50000&lt;BR /&gt;
                                                        BB         1         1.30    fatigue     0.16667&lt;BR /&gt;
                                                        BB         2         1.62    cyto        0.14286&lt;BR /&gt;
                                                        BB         2         1.62    pru         0.28571&lt;BR /&gt;
                                                        BB         2         1.62    flush       0.14286&lt;BR /&gt;
                                                        BB         2         1.62    infusion    0.28571&lt;BR /&gt;
                                                        BB         2         1.62    chills      0.28571&lt;BR /&gt;
                                                        BB         2         1.62    fatigue     0.14286&lt;BR /&gt;
                                                        BB         3         7.30    cyto        0.14286&lt;BR /&gt;
                                                        BB         3         7.30    pru         0.42857&lt;BR /&gt;
                                                        BB         3         7.30    flush       0.28571&lt;BR /&gt;
                                                        BB         3         7.30    infusion    0.57143&lt;BR /&gt;
                                                        BB         3         7.30    chills      0.28571&lt;BR /&gt;
                                                        BB         3         7.30    fatigue     0.42857&lt;BR /&gt;
                                                        BB         4         7.02    cyto        0.25000&lt;BR /&gt;
                                                        BB         4         7.02    pru         0.50000&lt;BR /&gt;
                                                        BB         4         7.02    flush       0.25000&lt;BR /&gt;
                                                        BB         4         7.02    infusion    0.75000&lt;BR /&gt;
                                                        BB         4         7.02    chills      0.87500&lt;BR /&gt;
                                                        BB         4         7.02    fatigue     0.37500&lt;BR /&gt;
                                                        BB         5        10.59    cyto        0.15385&lt;BR /&gt;
                                                        BB         5        10.59    pru         0.38462&lt;BR /&gt;
                                                        BB         5        10.59    flush       0.38462&lt;BR /&gt;
                                                        BB         5        10.59    infusion    0.69231&lt;BR /&gt;
                                                        BB         5        10.59    chills      0.69231&lt;BR /&gt;
                                                        BB         5        10.59    fatigue     0.61538&lt;BR /&gt;
                                                        BB         6         3.71    cyto        0.16667&lt;BR /&gt;
                                                        BB         6         3.71    pru         0.50000&lt;BR /&gt;
                                                        BB         6         3.71    flush       0.33333&lt;BR /&gt;
                                                        BB         6         3.71    infusion    0.83333&lt;BR /&gt;
                                                        BB         6         3.71    chills      0.83333&lt;BR /&gt;
                                                        BB         6         3.71    fatigue     0.83333&lt;BR /&gt;
                                                        BB         7         5.90    cyto        0.33333&lt;BR /&gt;
                                                        BB         7         5.90    pru         0.16667&lt;BR /&gt;
                                                        BB         7         5.90    flush       0.33333&lt;BR /&gt;
                                                        BB         7         5.90    infusion    0.66667&lt;BR /&gt;
                                                        BB         7         5.90    chills      0.66667&lt;BR /&gt;
                                                        BB         7         5.90    fatigue     1.00000&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ODS path (prepend) work.tempgrap;&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
  define statgraph aepanel/store=work.tempgrap;&lt;BR /&gt;
     begingraph/designwidth=10in designheight=4.5in;&lt;BR /&gt;
      layout gridded / rowgutter=0.5;&lt;BR /&gt;
        layout datapanel classvars=(vari) / columnaxisopts=(tickvalueattrs=(size=5)) &lt;BR /&gt;
                                            columns=2 rows=3 headerlabeldisplay=value&lt;BR /&gt;
		rowaxisopts=(griddisplay=on &lt;BR /&gt;
         display=(ticks tickvalues) linearopts=(viewmax=1 tickvaluepriority=true &lt;BR /&gt;
             						tickvaluesequence=(start=0 end=12 increment=1)) &lt;BR /&gt;
         							displaysecondary=(ticks tickvalues) &lt;BR /&gt;
							         altdisplaysecondary=(ticks tickvalues) &lt;BR /&gt;
									altdisplay=(ticks tickvalues)) ;&lt;BR /&gt;
		layout prototype /  cycleattrs=true;&lt;BR /&gt;
            seriesplot x=armcd y=mwtmean /yaxis=y2 display=(markers) &lt;BR /&gt;
                                       markerattrs=(size=9px weight=bold)&lt;BR /&gt;
                                       lineattrs=(thickness=2px)  name="series1";&lt;BR /&gt;
		   barchart x=armcd y=result/ primary=true  skin=modern outlineattrs=(color=black) name="series2";&lt;BR /&gt;
          endlayout;&lt;BR /&gt;
        endlayout;&lt;BR /&gt;
        discretelegend "series1" "series2";&lt;BR /&gt;
      endlayout;&lt;BR /&gt;
    endgraph;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods rtf file='test.rtf';&lt;BR /&gt;
&lt;BR /&gt;
proc sgrender data=one template=aepanel;  &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods rtf close;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 14 May 2010 21:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22872#M623</guid>
      <dc:creator>SusanParker</dc:creator>
      <dc:date>2010-05-14T21:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22873#M624</link>
      <description>The TICKVALUESEQUENCE in your template is what is keeping your bars compressed. If you remove that, you'l probably get the result you expect.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Fri, 14 May 2010 21:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22873#M624</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-05-14T21:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22874#M625</link>
      <description>Actually, when I take out the tickvaluesequence, then I didn't get the series plot at all and no errors.  I, then, commented out the viewmax and the series plot came back, but I still don't have independent axes.  I think if I could get the axes to independent, then there wouldn't be a problem with the bars being compressed.  They would be on the right hand axis and the series on the left.  &lt;BR /&gt;
&lt;BR /&gt;
Should we be trying something other than datapanel?&lt;BR /&gt;
&lt;BR /&gt;
Again, what we want is what was in the handout version of lab_values or in the set of SGRENDER examples, the humidity-dewpoint part of the 3-part lattice example, the right and left axes with their own scales.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 17 May 2010 15:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22874#M625</guid>
      <dc:creator>SusanParker</dc:creator>
      <dc:date>2010-05-17T15:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22875#M626</link>
      <description>Hey Susan,&lt;BR /&gt;
&lt;BR /&gt;
Try the template below and see if this is what you want.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan&lt;BR /&gt;
&lt;BR /&gt;
------------&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph aepanel/store=work.tempgrap;&lt;BR /&gt;
dynamic PANELNUM;&lt;BR /&gt;
begingraph/designwidth=10in designheight=4.5in;&lt;BR /&gt;
   layout gridded / rowgutter=0.5;&lt;BR /&gt;
      layout datapanel classvars=(vari) / columnaxisopts=(tickvalueattrs=(size=5)) &lt;BR /&gt;
                columns=1 rows=3 headerlabeldisplay=value panelnumber=PANELNUM&lt;BR /&gt;
                rowdatarange=union row2datarange=union columndatarange=unionall&lt;BR /&gt;
                rowaxisopts=(griddisplay=on display=(ticks tickvalues) &lt;BR /&gt;
                linearopts=(tickvaluepriority=true) &lt;BR /&gt;
                displaysecondary=(ticks tickvalues) &lt;BR /&gt;
                altdisplaysecondary=(ticks tickvalues) &lt;BR /&gt;
                altdisplay=(ticks tickvalues)) ;&lt;BR /&gt;
       layout prototype / cycleattrs=true;&lt;BR /&gt;
                barchart x=armcd y=result/ primary=true skin=modern &lt;BR /&gt;
                             outlineattrs=(color=black) name="series2";&lt;BR /&gt;
                seriesplot x=armcd y=mwtmean /yaxis=y2 display=(markers) &lt;BR /&gt;
                               markerattrs=(size=9px weight=bold)&lt;BR /&gt;
                               lineattrs=(thickness=2px) name="series1";&lt;BR /&gt;
       endlayout;&lt;BR /&gt;
   endlayout;&lt;BR /&gt;
   discretelegend "series1" "series2";&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods rtf file='test.rtf';&lt;BR /&gt;
&lt;BR /&gt;
proc sgrender data=one template=aepanel; &lt;BR /&gt;
dynamic panelnum=1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sgrender data=one template=aepanel; &lt;BR /&gt;
dynamic panelnum=2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods rtf close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 19 May 2010 14:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22875#M626</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-05-19T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22876#M627</link>
      <description>Hey Dan!&lt;BR /&gt;
&lt;BR /&gt;
It gives me a warning at row2datarange saying its assuming that rowdatarange was misspelled.  This is sort of why I figured datapanel may not be the way to go.  I was going to start trying to look for another option that had the y and y2 axisopts available.  Is row2 possibly available in 9.2M3, which isn't out for us yet?</description>
      <pubDate>Wed, 19 May 2010 14:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22876#M627</guid>
      <dc:creator>SusanParker</dc:creator>
      <dc:date>2010-05-19T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22877#M628</link>
      <description>Yes, you are correct. I think I assumed you to have 9.2m3 when you were attempting to assign the series plot to the y2 axis. I now understand why my earlier statement about removing TICKVALUESEQUENCE didn't work for you either :-). Given that your series data range is very different from your bar data range, the best option for you may be to use a LAYOUT OVERLAY to define graph with secondary axes and run the template in PROC SGRENDER using "vari" as a BY-group on the procedure. Let me know if that is acceptable.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Wed, 19 May 2010 15:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22877#M628</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-05-19T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22878#M629</link>
      <description>Thanks Dan!&lt;BR /&gt;
&lt;BR /&gt;
I'll give that a go later today.  M3 isn't available, right?</description>
      <pubDate>Wed, 19 May 2010 15:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22878#M629</guid>
      <dc:creator>SusanParker</dc:creator>
      <dc:date>2010-05-19T15:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22879#M630</link>
      <description>From what I understand, It has just now become available. If you're interested, just check with your representative for details.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Wed, 19 May 2010 15:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22879#M630</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-05-19T15:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Independent y-axes in datapanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22880#M631</link>
      <description>Just made my request.  Perhaps I won't have to figure out a new way to do that datapanel after all.&lt;BR /&gt;
&lt;BR /&gt;
Woo-hoo!</description>
      <pubDate>Wed, 19 May 2010 15:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Independent-y-axes-in-datapanel/m-p/22880#M631</guid>
      <dc:creator>SusanParker</dc:creator>
      <dc:date>2010-05-19T15:41:38Z</dc:date>
    </item>
  </channel>
</rss>

