Skip to content

Commit

Permalink
fix(resize) : fix resizing bug with bootstrap and angular material
Browse files Browse the repository at this point in the history
  • Loading branch information
houssemba committed Mar 2, 2017
1 parent bf24c5b commit 1fd3463
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
5 changes: 5 additions & 0 deletions dist/highcharts-ng.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
highcharts {
display: block;
width: 100%;
max-width: 100%;
}
12 changes: 11 additions & 1 deletion dist/highcharts-ng.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* highcharts-ng
* @version v1.0.2-dev - 2017-02-20
* @version v1.0.2-dev - 2017-03-02
* @link https://github.com/pablojim/highcharts-ng
* @author Barry Fitzgerald <>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -39,6 +39,16 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
prevConfig = angular.merge({}, ctrl.config);
mergedConfig = getMergedOptions($element, ctrl.config, seriesId);
ctrl.chart = new Highcharts[getChartType(mergedConfig)](mergedConfig);

// Fix resizing bug
// https://github.com/pablojim/highcharts-ng/issues/550
var originalWidth = $element[0].clientWidth;
var originalHeight = $element[0].clientHeight;
$timeout(function() {
if ($element[0].clientWidth !== originalWidth || $element[0].clientHeight !== originalHeight) {
ctrl.chart.reflow();
}
}, 0, false);
};

this.$doCheck = function() {
Expand Down
4 changes: 2 additions & 2 deletions dist/highcharts-ng.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/highcharts-ng.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
highcharts {
display: block;
width: 100%;
max-width: 100%;
}
10 changes: 10 additions & 0 deletions src/highcharts-ng.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
prevConfig = angular.merge({}, ctrl.config);
mergedConfig = getMergedOptions($element, ctrl.config, seriesId);
ctrl.chart = new Highcharts[getChartType(mergedConfig)](mergedConfig);

// Fix resizing bug
// https://github.com/pablojim/highcharts-ng/issues/550
var originalWidth = $element[0].clientWidth;
var originalHeight = $element[0].clientHeight;
$timeout(function() {
if ($element[0].clientWidth !== originalWidth || $element[0].clientHeight !== originalHeight) {
ctrl.chart.reflow();
}
}, 0, false);
};

this.$doCheck = function() {
Expand Down

0 comments on commit 1fd3463

Please sign in to comment.