Skip to content

[Bug] a second undefined canvas is drawn when drawing lines #19707

@Kurioni

Description

@Kurioni

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=lines-bmap

Steps to Reproduce

  1. Create several lines layers
  2. In Chrome, go to developer mode and observe the canvas

Current Behavior

2 canvas are drawn in dom, one of them with id equal to undefined

Expected Behavior

If zlevel is not specified, then all layers are drawn on one canvas

Environment

- OS: Win 10
- Browser: Chrome 122.0.6261.112
- Framework: React

Any additional comments?

We encountered a similar bug in our project when we noticed that there was an extra canvas in the dom (we did not specify zlevel). The problem was solved by specifying zlevel, but in theory it should be 0 by default.
A similar bug is also present in your examples (https://echarts.apache.org/examples/en/editor.html?c=lines-bmap), where we also noticed the same bug in one of them.

image

We noticed that when rendering a layer in zrender, the zlevel argument to the getLayer function may come with an undefined type.
image

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