Comments (6)
Managed a small hack on echart-components.ts
with
ngOnDestroy(): void { window.removeEventListener('resize', this.resizeListener, true); this.chart.resize(); }
Refer to this Stackoverflow Q&A: https://stackoverflow.com/questions/38158318/is-it-possible-to-use-echarts-baidu-with-angular-2-and-typescript
This gets rid of runtime errors - but there are other bugs as well ;)
from blog.
Hi
Looks like there is now an angular directive for echarts 3.x
https://github.com/xieziyu/ngx-echarts
Maybe this is the better way going forward.
from blog.
Thanks.
Your work has been of great value - your blog has been an eye opener.
from blog.
Hey
Took a look at the ngx-echarts - pretty comprehensive - thanks.
Try this if you get the runtime error (from ngx-echarts):
ngOnDestroy() { if (this.myChart) { this.myChart.dispose(); this.myChart = null; } }
It is a more consistent approach than my awkward hack.
from blog.
ngx-echarts
provides a wrapper for ECharts - very efficient for Angular Modules, but it feels like it's calling in an extra layer for Ionic to process.
Building out a custom component (like you did in your blog) seems more feasible.
Let me know what you think once you've played around with it.
I'll be posting a repo with ngx-echarts/echarts
soon.
Very handy solution, nonetheless.
from blog.
I changed the code of the blog to ngx-echarts. I like it better than my approach.
The only problem is that it does not automatically import the echarts library.
One solution that I use now is copying the directive into my project and add an import statement
import * as echarts from 'echarts/dist/echarts-en.js';
Another solution is creating a custom copy config that copies the echarts library to the www directory and then reference it in the index.html
copy.config.js
module.exports = {
copyEcharts: {
src: ['./node_modules/echarts/dist/echarts-en.min.js'],
dest: '{{WWW}}/build'
}
}
package.json
...
"config": {
"ionic_copy": "./copy.config.js"
},
...
from blog.
Related Issues (20)
- CORS preflight issue HOT 11
- /secret and /authenticate routes returning 403 HOT 2
- Throws error HOT 1
- sw-push not works HOT 1
- sw-push , Error creating bean with name 'registryController'... HOT 8
- sw-push, can you tell me messagingSenderId and gcm_sender_id are the same? HOT 14
- [ionic] ts error: FileEntry not found HOT 9
- JWT Authentification: check username HOT 4
- console.log(reader.result ) is {} HOT 5
- [Ionic-4] - no longer working for me HOT 7
- Getting error in polyfills.js line 3 - calls to REST services are showing status as canceled HOT 1
- Runtime Error after building the app in Ionic 4 HOT 2
- Check if file is uploaded HOT 4
- Crop image before upload it HOT 1
- POST http://localhost:8080/clienterror net::ERR_CONNECTION_REFUSED HOT 8
- hotcodepush app on Ionic 4 fails to load the updates HOT 9
- uploaded Image not rendered directly on screen HOT 4
- Runtime error -> jwt (Spring) HOT 2
- readAsArrayBuffer Not Supported HOT 1
- The example does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.