My project involves developing an Angular app to generate a dashboard featuring various charts within gridster items. The dashboard layout is structured using Angular-gridster, while the charts utilize n3-charts. When attempting to display a chart within a gridster item, I implement the following directive:
<div class="widget-main">
<div ng-show="widget.loadingData" class="loader">Loading...</div>
<widgetContentElement ng-show="!widget.loadingData"></widgetContentElement>
</div>
Within the widgetContentElement, the template includes:
<div id="linechartParent">
<linechart data="chartData" options="chartOptions" mode="" width="" height=""></linechart>
</div>
One challenging issue arises when displaying the chart in Safari, where it fails to adjust to fit the container properly. While Chrome and Firefox attempt to adjust the width, the height of the chart increases in 25px increments until an error is triggered:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"options","newVal":...
at angular.js:68
at Scope.$digest (angular.js:15934)
at Scope.$apply (angular.js:16160)
at done (angular.js:10589)
at completeRequest (angular.js:10787)
at XMLHttpRequest.requestLoaded (angular.js:10728)...
angular.js:68 Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"options","newVal":...
http://errors.angularjs.org/1.4.8/$rootScope/infdig?p0=10&p1=%5B%5B%7B%22ms…
at angular.js:68Scope.$digest @ angular.js:15934Scope.$apply @ angular.js:16160done @ angular.js:10589completeRequest @ angular.js:10787requestLoaded @ angular.js:10728
Interestingly, when using a CSS sliding menu, the chart is properly resized on Chrome and Firefox, allowing for zooming, sliding, etc. However, on Safari, the chart remains static and does not resize. I find this discrepancy between browsers perplexing, considering they theoretically utilize the same webkit, although potentially not the same JS engine.
If anyone has insights or suggestions on how to troubleshoot this issue, I would greatly appreciate it! Thank you.