/** * Draw the Y Axis increments * * @param array $yAxis * @param \ArrayObject $points * @param int $offset * @return void */ protected function showYAxis($yAxis, $points, $offset = 0) { $this->graph->adapter()->setStrokeWidth(1); $this->graph->adapter()->setStrokeColor($this->graph->getXColor()); $this->graph->adapter()->setFillColor($this->graph->getFontColor()); $i = 0; if ($offset != 0) { if ($this->graph->adapter() instanceof \Pop\Pdf\Pdf) { $realYDiv = ($points->yLength + $offset * 2) / (count($yAxis) - 1); $realZeroY = $points->zeroPoint['y'] - $realYDiv / 2; } else { $realYDiv = ($points->yLength - $offset * 2) / (count($yAxis) - 1); $realZeroY = $points->zeroPoint['y'] - $realYDiv / 2; } } else { $realYDiv = $points->yDiv; $realZeroY = $points->zeroPoint['y']; } foreach ($yAxis as $y) { $this->graph->adapter()->drawLine($points->zeroPoint['x'], $realZeroY - $realYDiv * $i, $this->graph->getWidth() - $this->graph->getPadding(), $realZeroY - $realYDiv * $i); $i++; } }