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] axisTick.customValues和axisLabel.formatter冲突 #20498

Open mchvip opened 1 week ago

mchvip commented 1 week ago

Version

5.5.1

Link to Minimal Reproduction

Steps to Reproduce

1、建立图表 2、配置axisTick.customValues axisTick: { alignWithLabel: true, customValues: [10, 100, 1000, 10000, 100000, 1000000] }, 1731312507168

3、配置axisLabel.formatter axisLabel: { showMinLabel: true, showMaxLabel: true, formatter: function (value) { return Number(value).toExponential(0) } }, 1731312540167

Current Behavior

未设置axisLabel.formatter之前,可以根据axisTick.customValues设置的值进行展示,设置了axisLabel.formatter,无法根据根据axisTick.customValues设置的值进行展示

Expected Behavior

无论是否设置axisLabel.formatter,都根据axisTick.customValues设置的值进行展示

Environment

- OS: win10
- Browser: chrome 130.0.6723.92
- Framework:

Any additional comments?

No response

echarts-bot[bot] commented 1 week ago

@mchvip It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Bug] conflict between axisTick.customValues ​​and axisLabel.formatter **BODY** ### Version 5.5.1 ### Link to Minimal Reproduction none ### Steps to Reproduce 1. Create a chart 2. Configure axisTick.customValues ` axisTick: { alignWithLabel: true, customValues: [10, 100, 1000, 10000, 100000, 1000000] }, ` ![1731312507168](https://github.com/user-attachments/assets/693abe99-52da-4dd9-856b-bf4e1787fc87) 3. Configure axisLabel.formatter ` axisLabel: { showMinLabel: true, showMaxLabel: true, formatter: function (value) { return Number(value).toExponential(0) } }, ` ![1731312540167](https://github.com/user-attachments/assets/215068fa-5a48-4a1c-b17b-487a9bf9af46) ### Current Behavior Before axisLabel.formatter is set, the display can be based on the value set by axisTick.customValues. After axisLabel.formatter is set, the display cannot be based on the value set by axisTick.customValues. ### Expected Behavior Regardless of whether axisLabel.formatter is set, it will be displayed based on the value set by axisTick.customValues. ### Environment ```markdown - OS: win10 - Browser: chrome 130.0.6723.92 - Framework: ``` ### Any additional comments? _No response_