vendor/amenadiel/jpgraph/src/image/Footer.php line 58

  1. <?php
  2. /**
  3.  * JPGraph v4.0.3
  4.  */
  5. namespace Amenadiel\JpGraph\Image;
  6. use Amenadiel\JpGraph\Text\Text;
  7. /**
  8.  * @class Footer
  9.  * // Description: Encapsulates the footer line in the Graph
  10.  */
  11. class Footer
  12. {
  13.     public $iLeftMargin   3;
  14.     public $iRightMargin  3;
  15.     public $iBottomMargin 3;
  16.     public $left;
  17.     public $center;
  18.     public $right;
  19.     private $iTimer;
  20.     private $itimerpoststring '';
  21.     public function __construct()
  22.     {
  23.         $this->left = new Text();
  24.         $this->left->ParagraphAlign('left');
  25.         $this->center = new Text();
  26.         $this->center->ParagraphAlign('center');
  27.         $this->right = new Text();
  28.         $this->right->ParagraphAlign('right');
  29.     }
  30.     public function SetTimer($aTimer$aTimerPostString '')
  31.     {
  32.         $this->iTimer           $aTimer;
  33.         $this->itimerpoststring $aTimerPostString;
  34.     }
  35.     public function SetMargin($aLeft 3$aRight 3$aBottom 3)
  36.     {
  37.         $this->iLeftMargin   $aLeft;
  38.         $this->iRightMargin  $aRight;
  39.         $this->iBottomMargin $aBottom;
  40.     }
  41.     public function Stroke($aImg)
  42.     {
  43.         $y $aImg->height $this->iBottomMargin;
  44.         $x $this->iLeftMargin;
  45.         $this->left->Align('left''bottom');
  46.         $this->left->Stroke($aImg$x$y);
  47.         $x = ($aImg->width $this->iLeftMargin $this->iRightMargin) / 2;
  48.         $this->center->Align('center''bottom');
  49.         $this->center->Stroke($aImg$x$y);
  50.         $x $aImg->width $this->iRightMargin;
  51.         $this->right->Align('right''bottom');
  52.         if ($this->iTimer != null) {
  53.             $this->right->Set(
  54.                 $this->right->.
  55.                 sprintf('%.3f'$this->iTimer->Pop() / 1000.0) .
  56.                 $this->itimerpoststring
  57.             );
  58.         }
  59.         $this->right->Stroke($aImg$x$y);
  60.     }
  61. }