apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] type为pictorialBar、symbolRepeat为true、containLabel为true 并且没有 symbolBoundingData时,浏览器缩放到极限时cpu 100%且崩溃 #20467

Open hymmyh opened 3 weeks ago

hymmyh commented 3 weeks ago

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoFsOzMYAbSIAXMgL4A06mAngIIAeEAzsUuZRnfUy-5nxgBMAhmCHFYAbQCMZWACZZAZlkAWWQFYAuhT5s-AcwBOEAT37nYuAKYAzMMQBEADgCkDnRb7H9AC3uxnNw9PDAAjYDBsAFtHdSDeT2wiAMUABlT3BIsAYxhRCGgAGSFQq1xiMEMAVytePUxGK2MrZkksjFQQzDAqECtHEAhs7GMhXAAhIUNMroxGKijw8oDDK2GZ2fnFvAAlKz6RR0qaja6tpYBZKf0CxylU-NnYc7wAZQgAL37Ye-CQ4VExGkslSIKUqm07VgJF4mhQJCAA&_source=echarts-doc-preview&version=5.5.0

Steps to Reproduce

1、用下面数据创建echart

option = {
    tooltip: {},
    yAxis: {},
    xAxis: {
            data:  [1, 2, 3, 4, 5],
    },
    grid: {
            left: "8%",
            right: "8%",
            bottom: "5%",
            top: "300",
            containLabel: true
    },
    series: [
        {
            type: "pictorialBar",
            symbol: "rect",
            symbolRepeat: "true",
            symbolMargin: "10%",
            symbolSize: 10,
            data: [1, 0, 0, 3, 4],
        }
    ]
}

https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoFsOzMYAbSIAXMgL4A06mAngIIAeEAzsUuZRnfUy-5nxgBMAhmCHFYAbQCMZWACZZAZlkAWWQFYAuhT5s-AcwBOEAT37nYuAKYAzMMQBEADgCkDnRb7H9AC3uxnNw9PDAAjYDBsAFtHdSDeT2wiAMUABlT3BIsAYxhRCGgAGSFQq1xiMEMAVytePUxGK2MrZkksjFQQzDAqECtHEAhs7GMhXAAhIUNMroxGKijw8oDDK2GZ2fnFvAAlKz6RR0qaja6tpYBZKf0CxylU-NnYc7wAZQgAL37Ye-CQ4VExGkslSIKUqm07VgJF4mhQJCAA&_source=echarts-doc-preview&version=5.5.0

2、浏览器打开F12

image

3、调整浏览器高度到最小

image

4、浏览器“性能监控” cpu 100% 然后浏览器崩溃。

image

Current Behavior

type为pictorialBar、symbolRepeat为true、containLabel为true 并且没有 symbolBoundingData时;缩放浏览器出现崩溃问题。

Expected Behavior

希望在后面的版本中修复这个bug。在缩放浏览器的情况下不要导致cpu 100% ,不要让浏览器崩溃。

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

helgasoft commented 3 weeks ago

yes, was able to reproduce in Chrome and Firefox - just need to resize vertically so that the bars disappear. Then they do not come back and tab freezes. Seems the culprit is containLabel, resizing works OK without it.