简体   繁体   English

导入exporting.js时出现错误“无法读取未定义的属性”文档”(以导出highchart图表)

[英]Getting error 'Cannot read property 'document' of undefined' while importing exporting.js (to export highchart charts)

I'm trying to export a highchart charts to a PDF file. 我正在尝试将海图图表导出为PDF文件。 For that, I've read that I should use exporting.js (and others libraries). 为此,我读到我应该使用exporting.js(和其他库)。 But when I import this library (exporting.js) I get this error: 'Cannot read property 'document' of undefined'. 但是,当我导入该库(exporting.js)时,出现以下错误:“无法读取未定义的属性'document'”。

I import this from a javascript: 我从javascript导入:

var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = '/resources/tda-ga/js/charts/lib/exporting.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);

I will appreciate any help! 我将不胜感激!

Please verify if you have the same version of exporting.js and highcharts.js module. 请验证您是否具有相同版本的exporting.js和highcharts.js模块。 It looks like you refer to the newest exporting.js but not up-to-date highcharts.js. 看起来您引用的是最新的exporting.js,而不是最新的highcharts.js。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 出现错误“无法读取未定义的属性”文档”(导出高图图表) - Getting error 'Cannot read property 'document' of undefined' (to export highchart charts) 在exporting.js中的Highchart中使用标头 - Using header in Highchart in the exporting.js 我收到错误无法读取未定义的属性“用户”而使用 Discord.JS - Im Getting The Error Cannot read property 'user' of undefined While Using Discord.JS 在 Discord JS 上出现错误“无法读取‘内容’未定义的属性” - Getting an error on Discord JS “cannot read property of 'content' undefined” 使用jquery获取导入Gmail联系人时(“未捕获的TypeError:无法读取未定义的属性'0') - While importing gmail contact by using jquery getting ("Uncaught TypeError: Cannot read property '0' of undefined) JS-Google图表-无法读取未定义的属性'getChartLayoutInterface' - JS - Google charts - Cannot read property 'getChartLayoutInterface' of undefined 在Express JS上使用Apollo Graphql导出makeExecutableSchema时,无法读取isDocumentNode上未定义的属性“种类” - Cannot read property 'kind' of undefined at isDocumentNode while export makeExecutableSchema using Apollo Graphql on express js 导入自定义模块时获取'无法读取未定义的属性'ɵmod'' - Getting 'Cannot read property 'ɵmod' of undefined' when importing custom module 关于FLOT CHARTS API错误:无法读取未定义的属性“ length” - regarding FLOT CHARTS API Error :Cannot read property 'length' of undefined 导入函数并使用“ this”获取道具:“ TypeError:无法读取未定义的属性'renderElapsedString'” - Importing function and getting props with “this”: “TypeError: Cannot read property 'renderElapsedString' of undefined”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM