pablojim / highcharts-ng

AngularJS directive for Highcharts
MIT License
1.73k stars 463 forks source link

out of stack space using IE11 #660

Open Valerio81 opened 4 years ago

Valerio81 commented 4 years ago

Your Environment

Hi, I've found a problem with IE11. When multiple charts was rendered, IE11 throw some "out of stack space" errors.

This is the JSFiddle with my code.

After some tests I think the problem is in "highcharts-ng" plugin in this function (row 103):

` this.$doCheck = function () { if (!detector(ctrl.config, prevConfig)) { prevConfig = angular.merge({}, ctrl.config); mergedConfig = getMergedOptions($element, ctrl.config, seriesId);

        //Remove any unlinked objects before adding
        this.removeUnlinkedObjects(mergedConfig);

        //Allows dynamic adding Axes
        this.addAnyNewAxes(mergedConfig.yAxis, ctrl.chart, false);
        this.addAnyNewAxes(mergedConfig.xAxis, ctrl.chart, true);

        //Allows dynamic adding of series
        if (mergedConfig.series) {
            // Add any new series
            angular.forEach(ctrl.config.series, function (s) {
                if (!ctrl.chart.get(s.id)) {
                    ctrl.chart.addSeries(s);
                }
            });
        }

        ctrl.chart.update(mergedConfig, true);
    }
};

`

To avoid the problem i've modified the function adding

if (ctrl.disableChangeDetection === true) { return; }

after the first row.

Is possible to fix the problem avoiding my workaround?