Skip to content

[Bug] resize() does not redraw chart with correct devicePixelRatio after browser zoom #21386

@danvk

Description

@danvk

Version

6.0.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=line-simple

Steps to Reproduce

  • Open any of the eCharts examples (e.g. line-simple).
  • Zoom in using the browser's zoom, e.g. Cmd+ on a Mac or Ctrl+ on a PC.
  • Observe that the chart is blurry.
  • Reload the page. The chart is now crisp at the new zoom level.

Current Behavior

Zooming results in a blurry chart, even after a call to myChart.resize(). You have to reload the page to get a crisp chart.

Screen.Recording.2025-11-21.at.2.21.25.PM.mov

Expected Behavior

The chart should detect changes in devicePixelRatio. Barring that, calling resize() when devicePixelRatio has changed should redraw the chart at the new devicePixelRatio.

Environment

- OS: macOS Sonoma 14.6.1 (23G93)
- Browser: Chrome 142.0.7444.162
- Framework: none

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions