private function get_axis($type, $index, $createifnotexists) {
        $isx = $type === 'x';
        if ($isx) {
            $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null;
        } else {
            $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null;
        }

        if ($axis === null) {
            if (!$createifnotexists) {
                throw new coding_exception('Unknown axis.');
            }

            $axis = new chart_axis();
            if ($isx) {
                $this->set_xaxis($axis, $index);
            } else {
                $this->set_yaxis($axis, $index);
            }
        }

        return $axis;
    }
private function get_axis($type, $index, $createifnotexists) {
        $isx = $type === 'x';
        if ($isx) {
            $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null;
        } else {
            $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null;
        }

        if ($axis === null) {
            if (!$createifnotexists) {
                throw new coding_exception('Unknown axis.');
            }

            $axis = new chart_axis();
            if ($isx) {
                $this->set_xaxis($axis, $index);
            } else {
                $this->set_yaxis($axis, $index);
            }
        }

        return $axis;
    }
private function get_axis ( $ type , $ index , $ createifnotexists ) { $ isx = $ type === 'x' ; if ( $ isx ) { $ axis = isset ( $ this -> xaxes [ $ index ] ) ? $ this -> xaxes [ $ index ] : null ; } else { $ axis = isset ( $ this -> yaxes [ $ index ] ) ? $ this -> yaxes [ $ index ] : null ; } if ( $ axis === null ) { if ( ! $ createifnotexists ) { throw new coding_exception ( 'Unknown axis.' ) ; } $ axis = new chart_axis ( ) ; if ( $ isx ) { $ this -> set_xaxis ( $ axis , $ index ) ; } else { $ this -> set_yaxis ( $ axis , $ index ) ; } } return $ axis ; }
Get an axis.

@param string $type Accepts values 'x' or 'y'.
@param int $index The index of this axis.
@param bool $createifnotexists Whether to create the axis if not found.
@return chart_axis
Get an axis .