hustcc / echarts-for-react

⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。
https://git.hust.cc/echarts-for-react
MIT License
4.51k stars 629 forks source link

Blank canvas after rendering #250

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi,

I'm seeing blank canvas after following instructions in the readme.

"dependencies": "antd": "^3.10.4", "echarts": "^3.8.5", "echarts-for-react": "^2.0.14", I have tried with latest version of echarts, I still have the same issue.

screenshot 2018-12-21 at 18 59 57
hustcc commented 5 years ago

what is your option?

ghost commented 5 years ago

Here is one (taken from echarts example). I have tried other options too. const option = { xAxis: { type: 'category', boundaryGap: false, data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [{ data: [820, 932, 901, 934, 1290, 1330, 1320], type: 'line', areaStyle: {} }] };

ghost commented 5 years ago

I'm able to reproduce this, using pure React.

https://codesandbox.io/s/pmpkvk155q

ghost commented 5 years ago

Parent of the target div is missing height and width. Works fine now.