michelson / lazy_high_charts

Make highcharts a la ruby , works in rails 5.X / 4.X / 3.X, and other ruby web frameworks
http://www.suipit.com
MIT License
1.05k stars 243 forks source link

Problem with defer loading in Rails #253

Closed kosappi closed 4 years ago

kosappi commented 4 years ago

If defer attribute is given to javascript_include_tag in Rails, no chart is drawn.

When I execute Highcharts.chart(… from devtool of the browser, it is drawn, so I expect that there is a problem with the execution timing.


This problem did not occur with using addEventListener instead of window.onload. So I committed my fix to forked repository. https://github.com/kosappi/lazy_high_charts/commit/620180d664b1987cebec3defbd8e23cba4fbad00 I tested this commit with my Rails application.


I completed the 4 steps below:

via: https://github.com/michelson/lazy_high_charts#contributing

xiaods commented 4 years ago

welcome pr on this patch.

kosappi commented 4 years ago

@xiaods

Thank you for reading this issue.

I created pr. https://github.com/michelson/lazy_high_charts/pull/254