function drawAxis()
 {
     $c = imagecolorallocatealpha($this->im, 255, 255, 255, 127);
     $style = array($c, $this->axis_color);
     imagesetstyle($this->im, $style);
     if (!isset($this->vlx)) {
         for ($i = 1; $i <= $this->cnt; $i++) {
             $this->vlx[$i] = $i;
         }
     }
     Graidle::imagelinethick($this->im, $this->s, $this->h - $this->b, $this->w - $this->d, $this->h - $this->b, $this->axis_color, 2);
     $this->vlx = array_reverse($this->vlx);
     $y = $this->s;
     if ($this->mnvs <= 0) {
         Graidle::imagelinethick($this->im, $this->s + abs($this->mnvs * $this->mul), $this->a, $this->s + abs($this->mnvs * $this->mul), $this->h - $this->b, $this->axis_color, 2);
         $y += abs($this->mnvs * $this->mul);
     }
     reset($this->vlx);
     $padding = 10;
     if (isset($this->spch) && $this->LegendAlign == "left") {
         $padding += $this->spacing + $this->dim_quad + $this->spch;
     }
     for ($i = $this->h - $this->b; $i >= $this->a; $i -= $this->ld) {
         imageline($this->im, $y, $i, $y - 3, $i, $this->axis_color);
         imagettftext($this->im, $this->font_small, 0, $padding, $i - $this->ld / 2 + $this->font_small / 2, $this->font_color, $this->font, current($this->vlx));
         next($this->vlx);
     }
 }
Example #2
0
 function drawAxis()
 {
     Graidle::imagelinethick($this->im, $this->s, $this->a, $this->s, $this->h - $this->b, $this->axis_color, 2);
     $n = 1;
     if (!isset($this->vlx)) {
         for ($i = 1; $i <= $this->cnt; $i++) {
             $this->vlx[$i] = $i;
         }
     } else {
         $n = 0;
     }
     for ($i = $this->s; $i <= $this->w - $this->d; $i += $this->disbar + $this->larg, $n++) {
         if (isset($this->vlx[$n])) {
             imageline($this->im, $i, $this->h - $this->b + 2, $i, $this->h - $this->b, $this->axis_color);
             imagefttext($this->im, $this->font_small, 0, $i + ($this->larg + $this->disbar) / 2 - $this->font_small * strlen($this->vlx[$n]) / 2, $this->h - $this->b + $this->font_small + 5, $this->font_color, $this->font, $this->vlx[$n]);
         }
     }
     if ($this->mnvs <= 0) {
         Graidle::imagelinethick($this->im, $this->s, $lu = $this->h - $this->b - abs($this->mn + $this->scarmin) * $this->mul, $this->w - $this->d, $lu, $this->axis_color, 2);
     }
 }
Example #3
0
 function drawLine()
 {
     $AA = $this->AA;
     if ($this->filled) {
         $thick = 1.5 * $AA;
         $sig = $thick * 3;
         $point = array();
     } else {
         $thick = 1.5 * $AA;
         $sig = $thick * 3;
     }
     $Htmp = $this->h * $AA;
     $Wtmp = ($this->w - $this->s - $this->d) * $AA;
     for ($t = 0; $t < count($this->value); $t++) {
         if ($this->type[$t] == 'l') {
             $img_tmp = imagecreatetruecolor($Wtmp, $Htmp);
             $trasp = imagecolorallocatealpha($img_tmp, 0, 0, 0, 127);
             imagefill($img_tmp, 0, 0, $trasp);
             $cc = $this->color[$t];
             list($name, $red, $green, $blue) = explode(',', $cc);
             $cc = imagecolorallocate($this->im, $red, $green, $blue);
             $rgbA = imagecolorallocatealpha($this->im, $red, $green, $blue, 60);
             $zero = ($this->h - $this->b - abs($this->mn + $this->scarmin) * $this->mul) * $AA;
             for ($x = 0, $x1 = ($this->larg + $this->disbar) / 2 * $AA, $i = 0, $i1 = 1; $i1 < count($this->value[$t]); $i++, $i1++, $x1 = $x2) {
                 if ($x == 0) {
                     $x2 = $x1 + ($this->disbar + $this->larg) * $AA;
                     if ($this->mnvs <= 0) {
                         $y1 = ($this->h - $this->b - $this->value[$t][$i] * $this->mul - abs($this->mnvs) * $this->mul) * $AA;
                         $y2 = ($this->h - $this->b - $this->value[$t][$i1] * $this->mul - abs($this->mnvs) * $this->mul) * $AA;
                         if ($this->value[$t][$i] >= 0) {
                             Graidle::imagelinethick($img_tmp, $x1, $y1, $x2, $y2, $cc, $thick);
                         } else {
                             Graidle::imagelinethick($img_tmp, $x1, $y1, $x2, $y2, $cc, $thick);
                         }
                         imagefilledellipse($img_tmp, $x1, $y1, $sig, $sig, $cc);
                         imagefilledellipse($img_tmp, $x2, $y2, $sig, $sig, $cc);
                     } else {
                         $y1 = $this->h - $this->b - ($this->value[$t][$i] - $this->mnvs) * $this->mul;
                         $y2 = $this->h - $this->b + $this->mnvs * $this->mul - $this->value[$t][$i1] * $this->mul;
                         if ($this->value[$t][$i] >= 0) {
                             Graidle::imagelinethick($img_tmp, $x1, $y1, $x2, $y2, $cc);
                             imagefilledellipse($img_tmp, $x1, $y1, $sig, $sig, $cc);
                             imagefilledellipse($img_tmp, $x1, $y2, $sig, $sig, $cc);
                         }
                     }
                     if ($this->filled) {
                         $point = array($x1, $zero, $x2 - 1, $zero, $x2 - 1, $y2, $x1, $y1);
                         imagefilledpolygon($img_tmp, $point, 4, $rgbA);
                         reset($point);
                     }
                 }
             }
             imagecopyresampled($this->im, $img_tmp, $this->s, 0, 0, 0, $Wtmp / $AA, $Htmp / $AA, $Wtmp, $Htmp);
             if (isset($rgb)) {
                 imagecolordeallocate($img_tmp, $rgb);
             }
             if (isset($trasp)) {
                 imagecolordeallocate($img_tmp, $trasp);
             }
             imagedestroy($img_tmp);
         }
     }
 }