miloschuman\highcharts\Highcharts::run PHP Method

run() public method

Renders the widget.
public run ( )
    public function run()
    {
        // determine the ID of the container element
        if (isset($this->htmlOptions['id'])) {
            $this->id = $this->htmlOptions['id'];
        } else {
            $this->id = $this->htmlOptions['id'] = $this->getId();
        }
        // render the container element
        echo Html::tag('div', '', $this->htmlOptions);
        // check if options parameter is a json string
        if (is_string($this->options)) {
            $this->options = Json::decode($this->options);
        }
        // merge options with default values
        $defaultOptions = ['chart' => ['renderTo' => $this->id]];
        $this->options = ArrayHelper::merge($defaultOptions, $this->options);
        array_unshift($this->scripts, $this->baseScript);
        $this->registerAssets();
        parent::run();
    }