Axis::__construct PHP Method

__construct() public method

public __construct ( $length, $max_val, $min_val, $min_unit, $fit = false )
    public function __construct($length, $max_val, $min_val = 0, $min_unit = 0, $fit = false)
    {
        if ($max_val <= $min_val && $min_unit == 0) {
            throw new Exception('Zero length axis');
        }
        $this->length = $length;
        $this->max_value = $max_val;
        $this->min_value = $min_val;
        $this->min_unit = $min_unit;
        $this->fit = $fit;
        $this->uneven = false;
    }

Usage Example

 /**
  * Constructor calls Axis constructor with 1/5 length
  */
 public function __construct($length, $max_val, $min_val, $min_unit, $fit, $units_before, $units_after, $decimal_digits, $label_callback)
 {
     if ($min_val < 0) {
         throw new Exception('Negative value for double-ended axis');
     }
     parent::__construct($length / 2, $max_val, $min_val, $min_unit, $fit, $units_before, $units_after, $decimal_digits, $label_callback);
 }
All Usage Examples Of Axis::__construct