You are here

function pSurface::addPoint in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pSurface.class.php \pSurface::addPoint()

File

pChart/class/pSurface.class.php, line 50

Class

pSurface

Code

function addPoint($X, $Y, $Value, $Force = TRUE) {
  if ($X < 0 || $X > $this->GridSizeX) {
    return 0;
  }
  if ($Y < 0 || $Y > $this->GridSizeY) {
    return 0;
  }
  if ($this->Points[$X][$Y] == UNKNOWN || $Force) {
    $this->Points[$X][$Y] = $Value;
  }
  elseif ($this->Points[$X][$Y] == UNKNOWN) {
    $this->Points[$X][$Y] = $Value;
  }
  else {
    $this->Points[$X][$Y] = ($this->Points[$X][$Y] + $Value) / 2;
  }
}