src/Classes/BaseChart.php
public function script(string $script = null)
    {
        if (count($this->datasets) == 0 && !$this->api_url) {
            throw new \Exception('No datasets provided, please provide at least one dataset to generate a chart');
        }

        if (!$script) {
            return View::make($this->script, ['chart' => $this]);
        }

        $this->script = $script;

        return $this;
    }
public function script(string $script = null)
    {
        if (count($this->datasets) == 0 && !$this->api_url) {
            throw new \Exception('No datasets provided, please provide at least one dataset to generate a chart');
        }

        if (!$script) {
            return View::make($this->script, ['chart' => $this]);
        }

        $this->script = $script;

        return $this;
    }
public function script ( string $ script = null ) { if ( count ( $ this -> datasets ) == 0 && ! $ this -> api_url ) { throw new \ Exception ( 'No datasets provided, please provide at least one dataset to generate a chart' ) ; } if ( ! $ script ) { return View :: make ( $ this -> script , [ 'chart' => $ this ] ) ; } $ this -> script = $ script ; return $ this ; }
Set the chart script.

@param string $script

@return self
Set the chart script .