Пример #1
0
 function _Translate($v)
 {
     return parent::Translate($v);
 }
Пример #2
0
 function _doManualTickPos(LinearScale $aScale)
 {
     $n = count($this->iManualTickPos);
     $m = count($this->iManualMinTickPos);
     $doLbl = count($this->iManualTickLabels) > 0;
     $this->maj_ticks_pos = array();
     $this->maj_ticklabels_pos = array();
     $this->ticks_pos = array();
     // Now loop through the supplied positions and translate them to screen coordinates
     // and store them in the maj_label_positions
     $minScale = $aScale->scale[0];
     $maxScale = $aScale->scale[1];
     $j = 0;
     for ($i = 0; $i < $n; ++$i) {
         // First make sure that the first tick is not lower than the lower scale value
         if (!isset($this->iManualTickPos[$i]) || $this->iManualTickPos[$i] < $minScale || $this->iManualTickPos[$i] > $maxScale) {
             continue;
         }
         $this->maj_ticks_pos[$j] = $aScale->Translate($this->iManualTickPos[$i]);
         $this->maj_ticklabels_pos[$j] = $this->maj_ticks_pos[$j];
         // Set the minor tick marks the same as major if not specified
         if ($m <= 0) {
             $this->ticks_pos[$j] = $this->maj_ticks_pos[$j];
         }
         if ($doLbl) {
             $this->maj_ticks_label[$j] = $this->iManualTickLabels[$i];
         } else {
             $this->maj_ticks_label[$j] = $this->_doLabelFormat($this->iManualTickPos[$i], $i, $n);
         }
         ++$j;
     }
     // Some sanity check
     if (count($this->maj_ticks_pos) < 2) {
         JpGraphError::RaiseL(25067);
         //('Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tickl marks.');
     }
     // Setup the minor tick marks
     $j = 0;
     for ($i = 0; $i < $m; ++$i) {
         if (empty($this->iManualMinTickPos[$i]) || $this->iManualMinTickPos[$i] < $minScale || $this->iManualMinTickPos[$i] > $maxScale) {
             continue;
         }
         $this->ticks_pos[$j] = $aScale->Translate($this->iManualMinTickPos[$i]);
         ++$j;
     }
 }