public function setAxisTicks($axis, array $ticks = array() )
    {
        if ( in_array($axis, array('x', 'y') ) ) {

            $isString = false;
            $alternateTicks = array();
            $cnt = 1;

            foreach ($ticks as $tick) {
                if (!(ctype_digit($tick) || is_int($tick))) {
                    $isString = true;
                    // this is O(2N) so deal with it
                    foreach ( $ticks as $tick ) {
                        $alternateTicks[] = array($cnt++, $tick);
                    }
                    break;
                }
            }
            
            $this->setNestedOptVal( $this->options, $axis.'axis', 'ticks', $isString ? $alternateTicks : $ticks );

        }

        return $this;
    }
public function setAxisTicks($axis, array $ticks = array() )
    {
        if ( in_array($axis, array('x', 'y') ) ) {

            $isString = false;
            $alternateTicks = array();
            $cnt = 1;

            foreach ($ticks as $tick) {
                if (!(ctype_digit($tick) || is_int($tick))) {
                    $isString = true;
                    // this is O(2N) so deal with it
                    foreach ( $ticks as $tick ) {
                        $alternateTicks[] = array($cnt++, $tick);
                    }
                    break;
                }
            }
            
            $this->setNestedOptVal( $this->options, $axis.'axis', 'ticks', $isString ? $alternateTicks : $ticks );

        }

        return $this;
    }
public function setAxisTicks ( $ axis , array $ ticks = array ( ) ) { if ( in_array ( $ axis , array ( 'x' , 'y' ) ) ) { $ isString = false ; $ alternateTicks = array ( ) ; $ cnt = 1 ; foreach ( $ ticks as $ tick ) { if ( ! ( ctype_digit ( $ tick ) || is_int ( $ tick ) ) ) { $ isString = true ; // this is O(2N) so deal with it foreach ( $ ticks as $ tick ) { $ alternateTicks [ ] = array ( $ cnt ++ , $ tick ) ; } break ; } } $ this -> setNestedOptVal ( $ this -> options , $ axis . 'axis' , 'ticks' , $ isString ? $ alternateTicks : $ ticks ) ; } return $ this ; }
Responsible for setting the tick labels on a given axis
@param string $axis
@param array $ticks
@return \Altamira\JsWriter\Flot
Responsible for setting the tick labels on a given axis