Accepted answer

This is a common issue with highcharts. The best advice I could get is to use window.resize() after Highcharts is shown, but actually there is an API function in Highcharts called reflow, that could also help.

The solution is to catch bootstrap modal events and update your Highcharts width in callback of event:

var chart = $('#container').highcharts();
$('#chart-modal').on('', function() {
    $('#container').css('visibility', 'hidden');
$('#chart-modal').on('', function() {
    $('#container').css('visibility', 'initial');

See demo. I use visibility css property here so Highchart won't bounce. This is not ideal, but better than nothing.


$('#J_report_graph').on('', function (event) {


will work as expected


Apply this

chart: {
 events: {
            load: function(chart) {
                 $timeout(function() {


for responsive highcharts with modal on bootstrap 3 just adding this line code on load page

$('#yourmodal').on('', function() {
    $('#yourselector').css('visibility', 'hidden');
$('#yourmodal').on('', function() {
    $('#yourselector').css('visibility', 'initial');


I tried the accepted solution, but in my case I didn't have an option to use a specific module id that already exist in the html, so solution below didn't work for me.

$('<modal-id>').on('', function() {

What I was trying to do is, dynamically adding a modal to the html as an EmberJS component which only has a specific class.

My solution was this:

App.registerComponentFactory('my-chart', SplineChart.extend({
    setup: (function() {
      .off('', '.my-modal')
      .on('', '.my-modal', () => this.reflow());

So each time my chart module is initialized, it binds the event handler to the modal. And the

.off('', '.my-modal')

part is also needed for unbinding the handler each time when the modal is triggered, otherwise the reflow function was running successfully only in the first attempt.

This may be useful for similar cases.

Related Query

More Query from same tag