59 if (!isset($this->options[
'chart']) || !isset($this->options[
'chart'][
'renderTo'])) {
60 $this->htmlOptions[
'id'] = $id;
61 echo
'<div ' . CHtml::renderAttributes($this->htmlOptions) .
' ></div>';
63 if (isset($this->options[
'chart']) && is_array($this->options[
'chart'])) {
64 $this->options[
'chart'][
'renderTo'] = $id;
66 $this->options[
'chart'] = array(
'renderTo' => $id);
79 $assets->registerPackage(
'highcharts');
81 $baseUrl = $assets->packages[
'highcharts'][
'baseUrl'];
83 $this->options = CMap::mergeArray(array(
'exporting' => array(
'enabled' =>
true)), $this->options);
85 if (isset($this->options[
'exporting']) && @$this->options[
'exporting'][
'enabled']) {
86 $assets->registerScriptFile(
$baseUrl .
'/modules/exporting.js');
88 if (isset($this->options[
'theme'])) {
89 $assets->registerScriptFile(
$baseUrl .
'/themes/' . $this->options[
'theme'] .
'.js');
92 $options = CJavaScript::encode($this->options);
94 $assets->registerScript(
95 __CLASS__ .
'#' . $this->getId(),
96 "var highchart{$this->getId()} = new Highcharts.Chart({$options});"