src/Classes/BaseChart.php
public function formatContainerOptions(string $type = 'css', bool $maxIfNull = false)
    {
        $options = '';
        $height = ($maxIfNull && !$this->height) ? '100%' : $this->height;
        $width = ($maxIfNull && !$this->width) ? '100%' : $this->width;

        switch ($type) {
            case 'css':
                $options .= " style='";
                (!$height) ?: $options .= "height: {$height}px !important;";
                (!$width) ?: $options .= "width: {$width}px !important;";
                $options .= "' ";
                break;
            case 'js':
                if ($height) {
                    if (is_int($height)) {
                        $options .= "height: {$height}, ";
                    } else {
                        $options .= "height: '{$height}', ";
                    }
                }
                if ($width) {
                    if (is_int($width)) {
                        $options .= "width: {$width}, ";
                    } else {
                        $options .= "width: '{$width}', ";
                    }
                }
                break;
            default:
                (!$height) ?: $options .= " height='{$this->height}' ";
                (!$this->width) ?: $options .= " width='{$this->width}' ";
        }

        return $options;
    }
public function formatContainerOptions(string $type = 'css', bool $maxIfNull = false)
    {
        $options = '';
        $height = ($maxIfNull && !$this->height) ? '100%' : $this->height;
        $width = ($maxIfNull && !$this->width) ? '100%' : $this->width;

        switch ($type) {
            case 'css':
                $options .= " style='";
                (!$height) ?: $options .= "height: {$height}px !important;";
                (!$width) ?: $options .= "width: {$width}px !important;";
                $options .= "' ";
                break;
            case 'js':
                if ($height) {
                    if (is_int($height)) {
                        $options .= "height: {$height}, ";
                    } else {
                        $options .= "height: '{$height}', ";
                    }
                }
                if ($width) {
                    if (is_int($width)) {
                        $options .= "width: {$width}, ";
                    } else {
                        $options .= "width: '{$width}', ";
                    }
                }
                break;
            default:
                (!$height) ?: $options .= " height='{$this->height}' ";
                (!$this->width) ?: $options .= " width='{$this->width}' ";
        }

        return $options;
    }
public function formatContainerOptions ( string $ type = 'css' , bool $ maxIfNull = false ) { $ options = '' ; $ height = ( $ maxIfNull && ! $ this -> height ) ? '100%' : $ this -> height ; $ width = ( $ maxIfNull && ! $ this -> width ) ? '100%' : $ this -> width ; switch ( $ type ) { case 'css' : $ options .= " style='" ; ( ! $ height ) ? : $ options .= "height: {$height}px !important;" ; ( ! $ width ) ? : $ options .= "width: {$width}px !important;" ; $ options .= "' " ; break ; case 'js' : if ( $ height ) { if ( is_int ( $ height ) ) { $ options .= "height: {$height}, " ; } else { $ options .= "height: '{$height}', " ; } } if ( $ width ) { if ( is_int ( $ width ) ) { $ options .= "width: {$width}, " ; } else { $ options .= "width: '{$width}', " ; } } break ; default : ( ! $ height ) ? : $ options .= " height='{$this->height}' " ; ( ! $ this -> width ) ? : $ options .= " width='{$this->width}' " ; } return $ options ; }
Formats the container options.

@param string $type
@param bool   $maxIfNull

@return string
Formats the container options .