plotSet - tag to display multiple plots

compared with
Current by Victor Serbo
on Oct 18, 2007 14:35.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 1 changes. View first change.

 h2.  plotSet overview
  
   
  
   The body of the plotSet tag is executed in the scope of plotter. The body can contain nested "style" tags, one plotSetBar tag, and one "region" tag.
  
   One must specify number of plots to be plotted:"nplots" or "plots" attribute.
  
 "plots" is a list of IManagedObjects to be plotted. Each object from the list is plotted in a separate plotter region. 
  
   There are other optional plotSet attributes, with default values, e.g.:
  
         height = 400 or 200*nX (pixels)
         width  = 600 or 300*nY (pixels)
         format = "png"
         statusVar = "status" (name of the variable that keeps PlotSetStatus object with the current status of the loop: index, plots, ....)
         allowDownload  = "true"
         createImageMap = "false"
         maxPlots = "9" (maximum number of plots per page)
         layout = "" (plot layout, must be in the form of nX x nY)
  
        Default layout:
         n Plots     nX x nY
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n<2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1x1
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1x2
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<=n<5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2x2
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5<=n<7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2x3
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7<=n<10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3x3
  
 &nbsp;PlotSetStatus object has the following properties:
  
 nplots, maxplots, plotsinpage, index, offset, offsetvariable, plots
  
 plotSet can also contain the plotSetBar tag with the following attributes:
  
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url&nbsp;\- required (The page to link the navigation bar to)
  
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var = "href" (name of the variable&nbsp;that keeps PlotSetBarStatus object with the current status of the bar hrefs: first, previous, last, ....)
  
 PlotSetBarStatus object has the following properties that are filled with hrefs:
  
  first, previous, next, last, pages
  defaultBar, first, previous, next, last, pages
  
 h2. &nbsp;&nbsp;
  
  
 h2. Examples:
  
  
 h3. 1. Very simple example - just plot using defaults
  
 {code}
  <!-- plot set of IManagedObjects -->
 <plotSet plots="${dataArray}" />
 {code}
  
 h3. 2.&nbsp;Set same style&nbsp;for all regions
  
 {code}
 <!--
     plot a set of IManagedObjects with a single
     plotter-level style
 -->
 <plotSet plots="${dataArray}">
     <style>
         .......
     </style>
 </plotSet>
 {code}
  
 h3. 3. Set different styles for odd and even regions
  
 {code}
 <!--
     plot a set of IManagedObjects with a different
     region-level styles
 -->
 <plotSet statusVar="status"> <region>
     <c:choose>
         <c:when test="${status.index%2 == 0}">
             <style>
                 .......
             </style>
         </c:when>
         <c:otherwise>
             <style>
                 .......
             </style>
         </c:otherwise>
     </c:choose> <plot var="${dataAray[status.index]}"/> </region>
 </plotSet>
 {code}
  
 h3. 4. Plot data with two overlays, each uses&nbsp;different style
  
 {code}
 <!--
  plot a set of IManagedObjects with overlays and
  individual data styles
 -->
 <plotSet statusVar="status">
  <style>
  .......
  </style>
  <region>
  <plot var="${dataArray1[status.index]}">
  <style>
  .......
  </style>
  </plot>
  <plot var="${dataArray2[status.index]}">
  <style>
  .......
  </style>
  </plot></region>
 </plotSet>
 {code}
  
 h3. 5. Make regions clickable with unique href-s and styles
  
 {code}
 <!--
  plot a set of IManagedObjects with overlays.
  Make regions clickable and with unique styles.
  *** Seems that we need to set "href" by-hand, since tag
  *** itself knows only IManagedObjects, not paths to them
 -->
 <plotSet createImageMap="true" statusVar="status">
  <region title = "Region ${status.index}" href = .... >
  <plot var="${dataArray1[status.index]}">
  <style>
  .......
  </style>
  </plot>
  <plot var="${dataArray2[status.index]}">
  <style>
  .......
  </style>
  </plot> </region>
 </plotSet>
 {code}