xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

[Q&A] the release version v2.1 have support Tree chart? #105

Open tan-ngoc-fpt opened 6 years ago

tan-ngoc-fpt commented 6 years ago

Im using Angular 4 and angular/cli: "1.4.9" I have used and config as yours guide:

"ngx-echarts": "2.1.0"
"echarts": "^4.1.0"

.angular-cli.json

 "scripts": [
      "../node_modules/echarts/dist/echarts.min.js"
 ]

But I got the error:


EchartsTreeComponent.html:1 ERROR Error: Component series.tree not exists. Load it first.
    at Function.t.getClass (scripts.bundle.js:52)
    at a.<anonymous> (scripts.bundle.js:46)
    at Array.forEach (<anonymous>)
    at h (scripts.bundle.js:45)
    at a.e (scripts.bundle.js:46)
    at Function.t.topologicalTravel (scripts.bundle.js:53)
    at a.mergeOption (scripts.bundle.js:46)
    at a.i (scripts.bundle.js:46)
    at a.resetOption (scripts.bundle.js:46)
    at a.setOption (scripts.bundle.js:46)

Thanks!

xieziyu commented 6 years ago

@tan-ngoc-fpt Yes, it supports. Did you restart ng serve after you upgrade echarts to v4?

tan-ngoc-fpt commented 6 years ago

@xieziyu Thank for reply. I'm using ngx-admin https://github.com/akveo/ngx-admin/, and config as yours guide, but it cannot show the Tree and dose not throw error. Am I missing any important point?

Thanks!

xieziyu commented 6 years ago

@tan-ngoc-fpt Could you provide more details about your codes? From your comments, I can only guess that your chart container element had no pre-defined height.