Code Monkey home page Code Monkey logo

Comments (7)

lydiafork avatar lydiafork commented on May 17, 2024 1

今天刚看到(ノへ ̄、)捂脸 ,实在不好意思,没有看GitHub消息的习惯
import Measure from 'react-measure';
初始化
this.state = { dimensions: { width: '100%', }, };

const { width } = this.state.dimensions;
return (
<Measure onMeasure={(dimensions) => { this.setState({ dimensions }); }} >
<div>
<ReactEcharts
ref={this.props.ref}
option={
mapDataToEcharts(data, color, name, maxy, unit, multiple)
}
notMerge
showLoading={false}
lazyUpdate
style={{ width, height: 175 }}
/>
</div>
</Measure>

from echarts-for-react.

hustcc avatar hustcc commented on May 17, 2024

肯定是你的代码 bug,可以贴下大概代码吗

from echarts-for-react.

cgd199158 avatar cgd199158 commented on May 17, 2024

应该不是代码bug的问题,highchart就不存在这种问题,网上找了下,好像是说echart在display:none后需要重新渲染一次才能正常显示.

from echarts-for-react.

hustcc avatar hustcc commented on May 17, 2024

可以看看在切换 tab 的时候,是否有 setOption 方法调用,或者 render 方法执行。

from echarts-for-react.

lydiafork avatar lydiafork commented on May 17, 2024

我也遇到了这个问题,echarts官方解答是切换的时候需要resize(),不过后来我是结合react-measure动态计算宽度解决的/(ㄒoㄒ)/~~

from echarts-for-react.

hustcc avatar hustcc commented on May 17, 2024

@lydiafork 可以大概贴一下代码,可以帮助下其他人。

from echarts-for-react.

cgd199158 avatar cgd199158 commented on May 17, 2024

@lydiafork 还要动态计算宽度吗?贴一下代码吧

from echarts-for-react.

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.