twp0217 / ngx-echarts

Apache ECharts component for Angular(基于 Angular 的 Apache ECharts 组件)
https://twp0217.github.io/ngx-echarts/
82 stars 25 forks source link

Cannot read property 'resize' of null or other property #36

Closed xiaoyaoyao closed 3 years ago

xiaoyaoyao commented 5 years ago

this.chart.resize(opts);

twp0217 commented 5 years ago

最新版已将默认提供的Echarts方法去除,请使用下面方法解决该问题: 1、使用[autoResize ]="true"让图表自适应 2、在onInit时接收图表实例,使用图表实例的resize方法

xiaoyaoyao commented 5 years ago

resize我放在AfterViewInit函数中的,因为存在异步处理和外部调用所以会报错,旧版本中没有提供autoResize这个属性,请问新版本支持angular4吗?我升级过报错需要angualr6+没有向下兼容。

------------------ 原始邮件 ------------------ 发件人: "twp0217"notifications@github.com; 发送时间: 2019年4月16日(星期二) 下午4:38 收件人: "twp0217/ngx-echarts"ngx-echarts@noreply.github.com; 抄送: "雪兮小妖"1209709682@qq.com; "Author"author@noreply.github.com; 主题: Re: [twp0217/ngx-echarts] Cannot read property 'resize' of null orother property (#36)

最新版已将默认提供的Echarts方法去除,请使用下面方法解决该问题: 1、使用[autoResize ]="true"让图表自适应 2、在onInit 时接收图表实例,使用图表实例的resize方法

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

twp0217 commented 5 years ago

给我一份你的package.json,我测试下

xiaoyaoyao commented 5 years ago

{ "name": "@frcloud/webapp", "version": "2.0.0", "description": "", "keywords": [ "angular2", "webpack", "typescript" ], "author": "fr", "homepage": "", "license": "", "dependencies": { "@angular/animations": "^4.4.4", "@angular/cdk": "^2.0.0-beta.12", "@angular/common": "^4.4.4", "@angular/compiler": "^4.4.4", "@angular/core": "^4.4.4", "@angular/flex-layout": "2.0.0-beta.10", "@angular/forms": "^4.4.4", "@angular/http": "^4.4.4", "@angular/platform-browser": "^4.4.4", "@angular/platform-browser-dynamic": "^4.4.4", "@angular/platform-server": "^4.4.4", "@angular/router": "^4.4.4", "@frcloud/xoc": "^1.0.0", "@types/leaflet": "1.2.7", "@types/proj4": "2.3.4", "@types/proj4leaflet": "1.0.5", "ag-grid-angular": "^19.0.0", "ag-grid-community": "^19.0.0", "ag-grid-enterprise": "^19.0.0", "angular-2-local-storage": "1.0.1", "angular-split": "0.2.2", "angular-tree-component": "^7.0.2-beta1", "angular2-qrcode": "^2.0.1", "angular2-uuid": "^1.1.1", "animate.css": "^3.5.2", "bootstrap": "^3.3.7", "bootstrap-datepicker": "^1.6.4", "bootstrap-sass": "^3.3.7", "bootstrap-slider": "^9.8.1", "coordtransform": "^2.1.2", "core-js": "^2.5.1", "echarts": "^4.2.0-rc.2", "echarts-liquidfill": "^1.1.0", "echarts-ng2": "^1.4.1", "element-resize-detector": "^1.1.12", "essence-ng2-print": "^1.1.0", "file-saver": "^1.3.3", "flatpickr": "^2.4.7", "font-awesome": "^4.7.0", "html2canvas": "^1.0.0-alpha.12", "jquery": "^2.0.0", "jqueryui": "^1.11.1", "jspdf": "^1.5.3", "loading-svg": "^1.0.0", "mobx": "^3.6.2", "mobx-angular": "^2.1.1", "ng-select2": "1.0.5", "ng2-file-upload": "^1.3.0", "ng2-toasty": "^4.0.0", "ng2-ui-switch": "^1.0.2", "ngx-color-picker": "^4.5.3", "ngx-cookie": "^1.0.0", "ngx-ui-switch": "^1.4.4", "node-sass": "^4.9.3", "rxjs": "^5.5.5", "tinycolor2": "^1.4.1", "ts-md5": "^1.2.0", "web-animations-js": "^2.2.5", "zone.js": "^0.8.17" }, "devDependencies": { "@angular/cli": "^1.7.3", "@angular/compiler-cli": "^4.4.4", "@angular/language-service": "^4.4.4", "@angularclass/hmr": "^2.1.3", "@types/baidumap-web-sdk": "^2.0.2", "@types/jasmine": "2.8.8", "@types/jquery": "3.3.2", "@types/jqueryui": "^1.11.36", "@types/node": "^8.0.25", "codelyzer": "^3.2.0", "gulp": "^3.9.1", "gulp-fontcustom": "^0.1.2", "jasmine-core": "^2.8.0", "jasmine-spec-reporter": "^4.2.1", "karma": "~1.7.0", "karma-chrome-launcher": "^2.2.0", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "lite-server": "^2.3.0", "prettier": "^1.8.2", "protractor": "~5.1.2", "rimraf": "^2.6.2", "source-map-explorer": "^1.4.0", "ts-node": "^3.3.0", "tslint": "^5.7.0", "typescript": "~2.6.2", "@types/jspdf": "^1.2.2", "@types/html2canvas": "^0.5.33" } }

------------------ 原始邮件 ------------------ 发件人: "twp0217"notifications@github.com; 发送时间: 2019年4月16日(星期二) 下午4:50 收件人: "twp0217/ngx-echarts"ngx-echarts@noreply.github.com; 抄送: "雪兮小妖"1209709682@qq.com; "Author"author@noreply.github.com; 主题: Re: [twp0217/ngx-echarts] Cannot read property 'resize' of null orother property (#36)

给我一份你的package.json,我测试下

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

twp0217 commented 5 years ago

我安装你的package.json错误,你试试把"echarts-ng2": "^1.4.1"^去除,然后再试试

xiaoyaoyao commented 5 years ago

我现在的版本没有问题,就是经常出现error property 'resize' of null。还有就是echarts-ngx兼容angular4吗?我升级echarts-ngx会报错。谢谢!

twp0217 commented 5 years ago

html页面和ts页面方便发来看下嘛,看下你怎么调用的

xiaoyaoyao commented 5 years ago

现在我安装不上,等我空闲了,试试哇!谢谢大神。

------------------ 原始邮件 ------------------ 发件人: "twp0217"notifications@github.com; 发送时间: 2019年4月18日(星期四) 晚上8:02 收件人: "twp0217/ngx-echarts"ngx-echarts@noreply.github.com; 抄送: "雪兮小妖"1209709682@qq.com; "Author"author@noreply.github.com; 主题: Re: [twp0217/ngx-echarts] Cannot read property 'resize' of null orother property (#36)

html页面和ts页面方便发来看下嘛,看下你怎么调用的

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.