miloschuman / yii2-highcharts

Highcharts widget for Yii 2 Framework
http://www.yiiframework.com/extension/yii2-highcharts-widget/
MIT License
166 stars 63 forks source link

HighchartsAsset::register($this)->withScripts(['highstock']); results with error 16 #77

Closed meduza777 closed 4 years ago

meduza777 commented 5 years ago

In browsers' web console i get highcharts error 16, when i want to use highstock with HighchartsAsset::register($this)->withScripts(['highstock']);

both highcharts.js highstock.js scripts is used by page. however highcharts.js should not be registered if highstock,js is used https://www.highcharts.com/errors/16/

problem is in src/HighchartsAsset.php line // make sure the highcharts base file is included first array_unshift($this->js, "highcharts.$ext"

miloschuman commented 5 years ago

Try using 'modules/stock' instead of 'highstock'.

HighchartsAsset::register($this)->withScripts(['modules/stock']);

To reduce potential conflicts, I started using highcharts new module pattern for imports, but I forgot to update the README file to reflect that.

miloschuman commented 4 years ago

Updated README to reflect new usage in commit c9715ee.