2amigos / yii2-chartjs-widget

ChartJs Widget For Yii2
https://2amigos.us
Other
109 stars 67 forks source link

Properties of chart inaccesible #33

Closed Eseperio closed 4 years ago

Eseperio commented 6 years ago

https://github.com/2amigos/yii2-chartjs-widget/blob/0b310668186711e73fcc73fba7eb07f0c174224e/src/ChartJs.php#L101

When registering clientScript the default context is View::POS_READY, that wraps all the javascript in a jquery function and makes it inaccesible.

If you are rendering many views in a component with renderPartial you will not be able to access javascript chart object in the browser..

Changing it to View::POS_END can solve this problem. Or maybe adding a parameter to change script position on demand.

tonydspaniard commented 6 years ago

@Eseperio have time for a PR?

Eseperio commented 6 years ago

Currently i don´t have so much free time, but i´ll try to make it.

tonydspaniard commented 6 years ago

@Eseperio I am on the same situation... :(