Example #1
0
 /**
  * Output the axis
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     $this->_canvas->startGroup(get_class($this));
     if (parent::_done() === false) {
         return false;
     }
     $this->_drawAxisLines();
     $this->_canvas->startGroup(get_class($this) . '_ticks');
     ksort($this->_labelOptions);
     foreach ($this->_labelOptions as $level => $labelOption) {
         $value = false;
         while (($value = $this->_getNextLabel($value, $level)) !== false) {
             if ((abs($value) > 0.0001 || $this->_showLabelZero) && ($value > $this->_getMinimum() || $this->_showLabelMinimum) && ($value < $this->_getMaximum() || $this->_showLabelMaximum) && $value >= $this->_getMinimum() && $value <= $this->_getMaximum()) {
                 $this->_drawTick($value, $level);
             }
         }
     }
     $this->_canvas->endGroup();
     $tickStart = -3;
     $tickEnd = 2;
     foreach ($this->_marks as $mark) {
         if (is_array($mark)) {
             if ($this->_type == IMAGE_GRAPH_AXIS_X) {
                 if ($this->_transpose) {
                     $x0 = $this->_right + $tickStart;
                     $y0 = $this->_point($mark[1]);
                     $x1 = $this->_right + $tickEnd;
                     $y1 = $this->_point($mark[0]);
                 } else {
                     $x0 = $this->_point($mark[0]);
                     $y0 = $this->_top + $tickStart;
                     $x1 = $this->_point($mark[1]);
                     $y1 = $this->_top + $tickEnd;
                 }
             } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y) {
                 if ($this->_transpose) {
                     $x0 = $this->_point($mark[0]);
                     $y0 = $this->_top + $tickStart;
                     $x1 = $this->_point($mark[1]);
                     $y1 = $this->_top + $tickEnd;
                 } else {
                     $x0 = $this->_right + $tickStart;
                     $y0 = $this->_point($mark[1]);
                     $x1 = $this->_right + $tickEnd;
                     $y1 = $this->_point($mark[0]);
                 }
             } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
                 if ($this->_transpose) {
                     $x0 = $this->_point($mark[0]);
                     $y0 = $this->_bottom + $tickStart;
                     $x1 = $this->_point($mark[1]);
                     $y1 = $this->_bottom + $tickEnd;
                 } else {
                     $x0 = $this->_left + $tickStart;
                     $y0 = $this->_point($mark[1]);
                     $x1 = $this->_left + $tickEnd;
                     $y1 = $this->_point($mark[0]);
                 }
             }
             $this->_getFillStyle();
             $this->_getLineStyle();
             $this->_canvas->rectangle(array('x0' => $x0, 'y0' => $y0, 'x1' => $x1, 'y1' => $y1));
         } else {
             if ($this->_type == IMAGE_GRAPH_AXIS_X) {
                 if ($this->_transpose) {
                     $x0 = $this->_right + 5;
                     $y0 = $this->_point($mark);
                     $x1 = $this->_right + 15;
                     $y1 = $y0;
                 } else {
                     $x0 = $this->_point($mark);
                     $y0 = $this->_top - 5;
                     $x1 = $x0;
                     $y1 = $this->_top - 15;
                 }
             } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y) {
                 if ($this->_transpose) {
                     $x0 = $this->_point($mark);
                     $y0 = $this->_top - 5;
                     $x1 = $x0;
                     $y1 = $this->_top - 15;
                 } else {
                     $x0 = $this->_right + 5;
                     $y0 = $this->_point($mark);
                     $x1 = $this->_right + 15;
                     $y1 = $y0;
                 }
             } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
                 if ($this->_transpose) {
                     $x0 = $this->_point($mark);
                     $y0 = $this->_bottom + 5;
                     $x1 = $x0;
                     $y1 = $this->_bottom + 15;
                 } else {
                     $x0 = $this->_left - 5;
                     $y0 = $this->_point($mark);
                     $x1 = $this->_left - 15;
                     $y1 = $y0;
                 }
             }
             $this->_getFillStyle();
             $this->_getLineStyle();
             $this->_canvas->line(array('x0' => $x0, 'y0' => $y0, 'x1' => $x1, 'y1' => $y1, 'end0' => 'arrow2', 'size0' => 5));
         }
     }
     $this->_canvas->endGroup();
     return true;
 }
Example #2
0
 /**
  * Update coordinates
  *
  * @return void
  * @access private
  */
 function _updateCoords()
 {
     $this->_setCoords($this->_parent->_plotLeft, $this->_parent->_plotTop, $this->_parent->_plotRight, $this->_parent->_plotBottom);
     parent::_updateCoords();
 }
Example #3
0
 /**
  * Sets the coordinates of the element
  *
  * @param int $left The leftmost pixel of the element on the canvas
  * @param int $top The topmost pixel of the element on the canvas
  * @param int $right The rightmost pixel of the element on the canvas
  * @param int $bottom The bottommost pixel of the element on the canvas
  * @access private
  */
 function _setCoords($left, $top, $right, $bottom)
 {
     parent::_setCoords($left, $top, $right, $bottom);
     $this->_updated = true;
 }
Example #4
0
 /**
  * Constructor
  */
 function Image_Graph_Marker()
 {
     parent::__construct();
 }