我正在使用 nvd3 图表(nvd3-1.8.5,d3-3.5.17),从角度 12 升级到角度 14 后面临以下问题。当它处于角度 12 时,我没有遇到任何问题。
Uncaught TypeError: Cannot read properties of undefined (reading 'document')
at d3.js:8:26
at 83064 (d3.js:1:2)
at __webpack_require__ (bootstrap:19:1)
at 54058 (index.ts:8:44)
at __webpack_require__ (bootstrap:19:1)
at 84096 (settings.saveview.html:41:141)
at __webpack_require__ (bootstrap:19:1)
at 70299 (UserServiceResolver.ts:18:33)
at __webpack_require__ (bootstrap:19:1)
at 64349 (viewlogmessage.html:65:57)
Run Code Online (Sandbox Code Playgroud)
即使我尝试使用 nvd3 1.8.5 和 d3 4.0.0(使用 Angular 14)也会遇到以下问题。
core.mjs:6397 ERROR TypeError: nv.dispatch.render_start is not a function
at Object.render (nv.d3.js:93:17)
at nv.addGraph (nv.d3.js:145:12)
at ViewActionsComponent.ts:169:17
at Array.forEach (<anonymous>)
at ViewActionsComponent.onGetMessageSuccessCallback (ViewActionsComponent.ts:140:11)
at SafeSubscriber._next (ViewActionsComponent.ts:83:36) …
Run Code Online (Sandbox Code Playgroud)