/**
* Draw the X Axis increments
*
* @param array $xAxis
* @param \ArrayObject $points
* @param int $offset
* @return void
*/
protected function showXAxis($xAxis, $points, $offset = 0)
{
$this->graph->adapter()->setStrokeWidth(1);
$this->graph->adapter()->setStrokeColor($this->graph->getYColor());
$this->graph->adapter()->drawLine($points->zeroPoint['x'], $points->zeroPoint['y'], $points->endX['x'], $points->endX['y']);
$this->graph->adapter()->setFillColor($this->graph->getFontColor());
$i = 0;
if ($offset != 0) {
$realXDiv = ($points->xLength - $offset * 2) / (count($xAxis) - 1);
$realZeroX = $points->zeroPoint['x'] + $realXDiv / 2;
} else {
$realXDiv = $points->xDiv;
$realZeroX = $points->zeroPoint['x'];
}
foreach ($xAxis as $x) {
if ($this->graph->adapter() instanceof \Pop\Pdf\Pdf) {
$this->graph->adapter()->drawLine($realZeroX + $realXDiv * $i, $points->zeroPoint['y'], $realZeroX + $realXDiv * $i, $this->graph->getHeight() - $this->graph->getPadding());
} else {
$this->graph->adapter()->drawLine($realZeroX + $realXDiv * $i, $points->zeroPoint['y'] - $points->yLength, $realZeroX + $realXDiv * $i, $points->zeroPoint['y']);
}
$i++;
}
}