public function __construct($datay, $datax = false) { parent::__construct($datay, $datax); // Calculate line coordinates as the average of the error limits $n = count($datay); for ($i = 0; $i < $n; $i += 2) { $ly[] = ($datay[$i] + $datay[$i + 1]) / 2; } $this->line = new LinePlot($ly, $datax); }
public function __construct($datay, $datax = false) { $ly = array(); $ey = array(); $n = count($datay); if ($n % 3 != 0) { Util\JpGraphError::RaiseL(4002); //('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3'); } for ($i = 0; $i < $n; $i += 3) { $ly[] = $datay[$i]; $ey[] = $datay[$i] + $datay[$i + 1]; $ey[] = $datay[$i] + $datay[$i + 2]; } parent::__construct($ey, $datax); $this->line = new LinePlot($ly, $datax); }