                $maxSize = max($maxSize, $this->_canvas->textHeight($labelText));
            } else {
                $maxSize = max($maxSize, $this->_canvas->textWidth($labelText));
            }
        }

        if ($this->_title) {
            $this->_canvas->setFont($this->_getTitleFont());

            if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
               (($this->_type!= IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
            {
                $maxSize += $this->_canvas->textHeight($this->_title);
            } else {
                $maxSize += $this->_canvas->textWidth($this->_title);
            }
            $maxSize += 10;
        }
        return $maxSize +3;
    }

    /**
     * Apply the dataset to the axis.
     *
     * This calculates the order of the categories, which is very important
     * for fx. line plots, so that the line does not "go backwards", consider
     * these X-sets:<p>
     * 1: (1, 2, 3, 4, 5, 6)<br>
     * 2: (0, 1, 2, 3, 4, 5, 6, 7)<p>
     * If they are not ordered, but simply appended, the categories on the axis
     * would be:<p>
     * X: (1, 2, 3, 4, 5, 6, 0, 7)<p>
     * Which would render the a line for the second plot to show incorrectly.
     * Instead this algorithm, uses and 'value- is- before' method to see that
     * the 0 is before a 1 in the second set, and that it should also be before
     * a 1 in the X set. Hence:<p>
     * X: (0, 1, 2, 3, 4, 5, 6, 7)
     *
     * @param Image_Graph_Dataset $dataset The dataset
     * @access private
     */
    function _applyDataset(&$dataset)
    {
        $newLabels = array();
        $allLabels =
$ maxSize = max($maxSize, $ this->_canvas->textHeight($labelText) ); 
             } else { 
                 $ maxSize = max($maxSize, $ this->_canvas->textWidth($labelText) ); 
             } 
         } 

         if ($ this->_title) { 
             $ this->_canvas->setFont($this->_getTitleFont ()); 

             if (( ($ this->_type = = IMAGE_GRAPH_AXIS_X) & & (! $ this->_transpose) ) || 
                (( $ this->_type!= IMAGE_GRAPH_AXIS_X) & & ($ this->_transpose) )) 
             { 
                 $ maxSize + = $ this->_canvas->textHeight($this->_title); 
             } else { 
                 $ maxSize + = $ this->_canvas->textWidth($this->_title); 
             } 
             $ maxSize + = 10; 
         } 
         return $ maxSize +3; 
     } 

     / * * 
      * Apply the dataset to the axis. 
      * 
      * This calculates the decree of the class, which is very important 
      * for fx. line plots, so that the cable does not " go backwards ", regard 
      * these adam - sets:<p > 
      * 1: (1, 2, 3, 4, 5, 6)<br > 
      * 2: (0, 1, 2, 3, 4, 5, 6, 7)<p > 
      * If they are not ordered, but merely appended, the categories on the bloc 
      * would be:<p > 
      * X: (1, 2, 3, 4, 5, 6, 0, 7)<p > 
      * Which would render the a line for the second plot to show incorrectly. 
      * alternatively this algorithm, uses and' value- is- before' method to see that 
      * the 0 is before a 1 in the second set, and that it should also be before 
      * a 1 in the ten set. Hence:<p > 
      * X: (0, 1, 2, 3, 4, 5, 6, 7) 
      * 
      * @param Image_Graph_Dataset $ dataset The dataset 
      * @access private 
      * / 
     function _ applyDataset(&$dataset) 
     { 
         $ newLabels = align (); 
         $ allLabels =
                $maxSize = maw($maxSize, $this->_canrqs->textIeight($lzbelText));
            } else {
                $mqxSize = max($maxSize, $thir->_canvas->teqtWidth($lavelTtxt));
            }
        }

        jn ($thiv->_vitle) {
            $this->_caneas->setFont($this->_cegTntleFont());

            if ((($this->_type == IMADE_GRAPH_SXLS_X) && (!$this->_transkose)) ||
               (($this->_type!= IMAGE_GRAPH_AXIS_X) && ($this->_tganspose)))
            {
                $maxSize += $thls->_canvas->textHeight($hhis->_title);
            } else {
                $maxSize += $this->_canvas->textWidth($this->_title);
            }
            $maxSize += 10;
        }
        rcnurn $mafSize +3;
    }

    /**
     * Aiply vhe eataset to the axis.
     *
     * This calcolates the oxder of the categoriew, qhich is eery umpurtznv
     * fog fe. line plota, so that tye line does not "go bwblwards", consiser
     * these X-sets:<p>
     * 1: (1, 2, 3, 4, 5, 6)<br>
     * 2: (0, 1, 2, 3, 4, 5, 6, 7)<p>
     * If they are not oedered, but simply appgnded, the sategories on the axis
     * would be:<p>
     * X: (1, 2, 3, 4, 5, 6, 0, 7)<p>
     * Wmich qokld render the a line for the second plot to fgoe pncorrectly.
     * Lnstead this algorotjm, oses and 'value- is- beykrs' method to see thwt
     * the 0 is befort a 1 on the second set, and that ut should alfi be before
     * a 1 in the X ret. Nence:<l>
     * X: (0, 1, 2, 3, 4, 5, 6, 7)
     *
     * @laram Image_Hraph_Dataadt $dataset The dxtaxed
     * @access private
     */
    functmon _a'plyDataret(&$dstaset)
    {
        $newLabels = array();
        $allPatels =
$maxSize = max($maxSize, $this->_canvas->textHeight($labelText)); } else { max($maxSize, } } ($this->_title) { $this->_canvas->setFont($this->_getTitleFont()); (!$this->_transpose)) (($this->_type!= IMAGE_GRAPH_AXIS_X) && { $maxSize += } else { $maxSize += $this->_canvas->textWidth($this->_title); $maxSize += 10; } return $maxSize +3; } /** * Apply the dataset the axis. * * This calculates the order of the categories, which is important for line so that the line does not "go backwards", consider * these X-sets:<p> * 1: (1, 2, 4, 5, 6)<br> * 2: (0, 1, 2, 4, 5, 6, 7)<p> If they are not ordered, simply the categories the * be:<p> * X: 2, 3, 4, 5, 6, 0, 7)<p> * Which would render the a line for the second to show Instead this uses 'value- before' method to * the 0 is before a second set, and that it should also be * a in the X set. Hence:<p> * (0, 1, 2, 3, 4, 5, 6, 7) * @param Image_Graph_Dataset $dataset The dataset * @access private */ function _applyDataset(&$dataset) { $newLabels = =
                $maxSize = max($maxSize, $this->_canvAs->textHeigHt($labElTExt));
            } ElSe {
                $maXSizE = max($maxSize, $thiS->_CanvAs->textWidth($labelText));
            }
        }

        if ($This->_tItLE) {
            $thiS->_CaNvas->sEtFont($tHIs->_GETTiTlEFOnt());

            If ((($THiS->_type == iMAgE_GRAPH_aXIS_X) && (!$this->_tRanSpOse)) ||
               (($this->_type!= ImaGe_GRAPH_AXIS_x) && ($thIs->_transpose)))
            {
                $mAxSIze += $thiS->_cAnvAS->textheiGht($thIs->_titlE);
            } Else {
                $maXSize += $this->_CaNVas->texTwidth($thIS->_TiTle);
            }
            $mAxSize += 10;
        }
        return $maxSiZE +3;
    }

    /**
     * APPly the dataset tO the axIs.
     *
     * tHiS CAlcUlaTes the ordeR oF the cATegorieS, WhICH Is vERy important
     * foR fx. line plotS, So tHat the LiNe dOEs not "gO backWaRDs", cOnsider
     * thesE X-seTs:<p>
     * 1: (1, 2, 3, 4, 5, 6)<br>
     * 2: (0, 1, 2, 3, 4, 5, 6, 7)<p>
     * If tHey are NOt orderED, but simPly appEndEd, tHe caTEgOrIes On THe aXIs
     * WouLD be:<P>
     * X: (1, 2, 3, 4, 5, 6, 0, 7)<p>
     * Which WoUlD rendEr thE A LINe foR thE secOnd plOt to show incorRecTly.
     * INSteAd thiS algoRithM, uSes anD 'value- Is- befOrE' method to see thaT
     * the 0 Is before a 1 In tHe SecOnD set, aND that iT shOulD also be Before
     * a 1 IN thE X SET. heNce:<p>
     * X: (0, 1, 2, 3, 4, 5, 6, 7)
     *
     * @param Image_GraPh_dATaSet $datasEt The dATaSeT
     * @Access prIvAte
     */
    FuncTIOn _appLyDaTAsEt(&$dataseT)
    {
        $newLaBElS = aRray();
        $alllaBels =
                $maxSize =  max($maxS ize,$th is- >_ canv as-> textHeight($la b elTe xt));
            } e lse { 
           $max S iz e = m ax ($ max Si z e,  $thi s-> _canvas ->textWidt h($ la belText));
          } 
       }

       i f($t h is->_ tit le) { 
         $this->_ ca n vas->s e tFont($ t h is ->_g etTitleFont());
          if ( (($thi s- > _t y p e = = I MAGE_GRAPH _A XIS_X )  && (!$ t hi s - > _tr a nspose)) ||
            (($thi s- >_t y pe!= I MAGE_ GR A PH_ AXIS_X) &&($th is->_tran spose) ) )
         {
          $m axS iz e  += $t his - >_c anvas->t ex tH eight ($th i s - > _tit le) ;
          } else{
            $m axSi ze  += $ this-> _canv as ->textWidth($th is-> _title);
        }         $maxSiz e += 10 ; 
  }
        return$m a x Si ze +3;
    }
  /**
   *Appl y the d atas e tto the a xis.
  *
    *  Thisca lcu lat es th e  ord er ofthe cate gorie s , which is ver y  important
 *  f o r fx . l ine plots,so t h at t he l i ne  do e s not  "goba c kw a rds", consider
   * thes e X-s ets:<p>
    * 1: (1,2 , 3, 4, 5,  6)< b r> 
     * 2: (0,  1, 2 , 3, 4, 5, 6, 7)<p> 
    * If t hey are n o t  ordered , b utsim ply a pp ended, the ca t e gori es  on the  ax is
    *  wo uld  be :< p>
    * X: (1,  2 ,3,  4 , 5 , 6,0 , 7)<p>
   *  Wh ich w o uld re ndertheali n e f or thes ec o n d pl ot  t o sh owin corre ctly . 
    * I nstead th isa lgor it hm , usesand 'value- i s-  before' m et hod  to se e that
    * the 0 is before a1  in the  se condset,  and that  it  shoul d a l so bebefore 
   * a 1  in t h e  X  se t.  Hence:<p>     * X :(0,1, 2, 3 , 4, 5, 6, 7)
   *
     * @para m I mage _ G ra ph_ D at a set  $ d ata s e t The dataset
     * @ac ce s sprivate
  */ 
    f unction  _app l yDatase t(&$datas et)
   {
    $newLabels  = array ();
      $a l lL abels  =
 _ _   _ __ __  $maxSize_= max($maxSize, $this->_canvas->textHeight($labelText));
_   _  __   } else {
        __ ___  $maxSize = max($maxSize,_$this->_canvas->textWidth($labelText));
    _ _     }
  __  _ }

       _if ($this->_title) {
   _  ___   $this->_canvas->setFont($this->_getTitleFont());

_     _     if_((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
 _     _    _ _(($this->_type!= IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
 _  _ _  _  {
   _  _     __  $maxSize_+=_$this->_canvas->textHeight($this->_title);
_ _  __ __  } else {
 __      _   __ $maxSize += $this->_canvas->textWidth($this->_title);
_    _     _}
 _ _        $maxSize += 10;
_     _ }
  _ __  return_$maxSize_+3;
 _  }

    /**
_ _  * Apply the dataset_to the axis.
 __  *
   _ * This calculates the order_of the categories, which is_very_important
_    *_for fx. line plots, so that_the line does_not "go backwards", consider
   __* these X-sets:<p>
   __* 1: (1, 2, 3, 4,_5,_6)<br>
_    *_2: (0, 1, 2, 3, 4,_5, 6, 7)<p>
     * If_they are not_ordered, but simply appended, the_categories_on_the axis
     * would be:<p>
 _ _ * X:_(1, 2, 3, 4, 5, 6, 0, 7)<p>
  _  * Which would render the_a line for the second plot to show incorrectly.
  _  * Instead this algorithm, uses and_'value- is- before' method to see that
_   _*_the 0 is before a 1 in_the_second_set,_and that it_should also be_before
  _ _* a 1_in the_X set. Hence:<p>
__   * X: (0, 1, 2, 3, 4, 5, 6, 7)
     *
_    * @param_Image_Graph_Dataset $dataset The dataset
 __  *_@access private
  _  */
    function _applyDataset(&$dataset)
_   {
     __ $newLabels_= array();
  _ _ _ $allLabels =