Giter Site home page Giter Site logo

Comments (5)

jamessawyer avatar jamessawyer commented on May 21, 2024

和这个问题 - when init echarts on DEV env, warn can't get dom width or height 比较像

from ngx-echarts.

xieziyu avatar xieziyu commented on May 21, 2024

请尝试给你的app-line-echarts固定宽度

from ngx-echarts.

jamessawyer avatar jamessawyer commented on May 21, 2024

@xieziyu 给固定宽度就达不到宽度自适应的效果了,还有就是依然会有警告,我准备放弃用tabset组件了,准备直接使用按钮的方式。

from ngx-echarts.

xieziyu avatar xieziyu commented on May 21, 2024

这个问题和tabset组件的实现机制有关系。可以试一下一些workaround:
1、使用ngx-bootstrap的tabset组件
or
2、利用chartInstance的resize()函数
or
3、利用空的options或者*ngIf等其他方式延缓app-total-line渲染时间点到tab切换完成之后

2、3方法我觉得只是理论上可行的,但并不推荐这么做。重要的是要理解为什么tabset组件中,echarts无法获取到父容器的clientWidth或者clientHeight,然后以此改进。

from ngx-echarts.

jamessawyer avatar jamessawyer commented on May 21, 2024

第2种方式使用过了,没有效果。第3种方式尝试使用setTimeout延迟echarts渲染,但是没起作用。tabset组件中为什么无法获取父容器宽高,但是最后还是渲染了,并且给了100px的宽,这是我最想不通的地方。这个暂时一下无法理解其中的原理,待进一步去学习了,谢谢大佬了 @xieziyu

from ngx-echarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.