Manually trigger window resize event doesn't cause charts to resize
See original GitHub issueFirst of all, thanks for building these beautiful charts, and forgive me if I am wrong.
I manually trigger window resize event with
$(window).trigger('resize')
However, this doesn’t cause chart.js charts to reize.
Any advice will be appreciated, thanks in advance 😃
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to trigger the window resize event in JavaScript?
It only triggers event listeners that have been added using jQuery. In my case, a 3rd party library was listening directly to the...
Read more >A problem with resizing a dxChart - DevExpress Support
The idea from this was to call browser window resize event manually, so the graph would think the browser is resized and would...
Read more >Responsive Charts - Chart.js
To support resizing charts when printing, you need to hook the onbeforeprint (opens new window) event and manually trigger resizing of each ...
Read more >Window: resize event - Web APIs | MDN
The resize event fires when the document view (window) has been resized. This event is not cancelable and does not bubble.
Read more >Trigger window's resize event with JavaScript/jQuery
1. Using jQuery. In jQuery, you can trigger the window resize event using the .trigger() method.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you trigger the on-resize you can add your chart to the call like this.
$( window ).resize(function() { myChart.resize(); });
I fired the event using this, as I put the chart in a slideToggle div and to redisplay, in the onComplete function I added var evt = document.createEvent(‘UIEvents’); evt.initUIEvent(‘resize’, true, false,window,0); window.dispatchEvent(evt);
@nnnick - Anyway, why chart doesn’t show in bootstrap modal when I set responsive options is
true
? I shout resize browser manually then chart will came up.