protected function registerAssets()
{
// register the necessary script files
HighchartsAsset::register($this->view)->withScripts($this->scripts);
// prepare and register JavaScript code block
$jsOptions = Json::encode($this->options);
$setupOptions = Json::encode($this->setupOptions);
$js = "Highcharts.setOptions({$setupOptions}); new Highcharts.{$this->constr}({$jsOptions});";
$key = __CLASS__ . '#' . $this->id;
if (is_string($this->callback)) {
$js = "function {$this->callback}(data) {{$js}}";
}
$this->view->registerJs($js, View::POS_READY, $key);
}