question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autoresize does not work when container is grid

See original GitHub issue

Confirmation

  • I can confirm this problem is not reproducible with ECharts itself.

How are you introducing Vue-ECharts into your project?

ES Module imports

Versions

+-- @tanstack/vue-table@8.5.22
| `-- vue@3.2.45 deduped
+-- @vitejs/plugin-vue@3.2.0
| `-- vue@3.2.45 deduped
+-- @vueuse/core@9.5.0
| +-- @vueuse/shared@9.5.0
| | `-- vue-demi@0.13.11
| |   `-- vue@3.2.45 deduped
| `-- vue-demi@0.13.8
|   `-- vue@3.2.45 deduped
+-- echarts@5.4.0
+-- floating-vue@2.0.0-beta.20
| +-- vue-resize@2.0.0-alpha.1
| | `-- vue@3.2.45 deduped
| `-- vue@3.2.45 deduped
+-- pinia@2.0.27
| +-- vue-demi@0.13.6
| | `-- vue@3.2.45 deduped
| `-- vue@3.2.45 deduped
+-- sortablejs-vue3@1.2.3
| `-- vue@3.2.45 deduped
+-- vue-echarts@6.2.3
| +-- echarts@5.4.0 deduped
| +-- vue-demi@0.13.5
| | `-- vue@3.2.45 deduped
| `-- vue@3.2.45 deduped
+-- vue-router@4.1.3
| `-- vue@3.2.45 deduped
`-- vue@3.2.45
  `-- @vue/server-renderer@3.2.45
    `-- vue@3.2.45 deduped

Details

The autoresize does not work when the containing element has display:grid set and the window is resized to be smaller. It only kind of works when the size increases.

autoresize

Reproduction

https://stackblitz.com/edit/vue-echarts-vue-3-dfksyi?file=src%2FApp.vue

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Justineocommented, Dec 13, 2022

If you are using an external resize observer library, you may want to disable the built-in autoresize as you’ll end up calling chart.resize() twice in many cases.

1reaction
Justineocommented, Dec 2, 2022

Try add this in your CSS to workaround the issue:

x-vue-echarts {
  overflow: hidden;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

AutoResize does not work properly in ui-grid
I don't specified a width or height for the grid and used "ui-grid-auto-resize". It is working but not properly. There is just a...
Read more >
autoSize doesn't work, either throws warnings or fails to ...
I'm expecting autoSize to take care of resizing the height, which it does when I leave out the h attribute of layout GridDataItems....
Read more >
How to Autosize a container like Grid on navigating away ...
I have a landing page that has a Grid to layout various visual elements. All works fine as expected when resizing the window...
Read more >
Auto-Sizing Columns in CSS Grid: `auto-fill` vs `auto-fit`
So we need to start by specifying a minimum width for the columns, making sure they don't get too narrow. We can do...
Read more >
Auto-placement in grid layout - CSS: Cascading Style Sheets
If the grid does not have enough rows in the explicit grid to place all of the items new implicit rows will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found