You are here

function pChart::drawGraphArea in Visitors 8

Same name and namespace in other branches
  1. 7.0 pchart/pChart.inc \pChart::drawGraphArea()

File

pchart/pChart.inc, line 227

Class

pChart

Code

function drawGraphArea($R, $G, $B, $Stripe = FALSE) {
  $this
    ->drawFilledRectangle($this->GArea_X1, $this->GArea_Y1, $this->GArea_X2, $this->GArea_Y2, $R, $G, $B, FALSE);
  $this
    ->drawRectangle($this->GArea_X1, $this->GArea_Y1, $this->GArea_X2, $this->GArea_Y2, $R - 40, $G - 40, $B - 40);
  if ($Stripe) {
    $R2 = $R - 15;
    if ($R2 < 0) {
      $R2 = 0;
    }
    $G2 = $R - 15;
    if ($G2 < 0) {
      $G2 = 0;
    }
    $B2 = $R - 15;
    if ($B2 < 0) {
      $B2 = 0;
    }
    $LineColor = imagecolorallocate($this->Picture, $R2, $G2, $B2);
    $SkewWidth = $this->GArea_Y2 - $this->GArea_Y1 - 1;
    for ($i = $this->GArea_X1 - $SkewWidth; $i <= $this->GArea_X2; $i = $i + 4) {
      $X1 = $i;
      $Y1 = $this->GArea_Y2;
      $X2 = $i + $SkewWidth;
      $Y2 = $this->GArea_Y1;
      if ($X1 < $this->GArea_X1) {
        $X1 = $this->GArea_X1;
        $Y1 = $this->GArea_Y1 + $X2 - $this->GArea_X1 + 1;
      }
      if ($X2 >= $this->GArea_X2) {
        $Y2 = $this->GArea_Y1 + $X2 - $this->GArea_X2 + 1;
        $X2 = $this->GArea_X2 - 1;
      }

      // * Fixed in 1.27 *         { $X2 = $this->GArea_X2 - 1; $Y2 = $this->GArea_Y2 - ($this->GArea_X2 - $X1); }
      imageline($this->Picture, $X1, $Y1, $X2, $Y2 + 1, $LineColor);
    }
  }
}