echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] 通过xAxis.axisTick.interval控制刻度展示和实际展示效果不一致

Open sunjiesama opened this issue 1 year ago • 3 comments

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-smooth&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXLANprrJnmxgCeIApkQOQDGAhmPQObABONTADSVyAEw5sixJgFkYQ2EwAqAV3oKmAdXqiNSgBYqmAXREBfYVVRV0tBs3ace_ISPTiwkkkz1qN_40sbEGA8CEgYZgAjYDAwYABbVxtYYAAzNLx6MCIARgAGIKo2XDwAGQhoRgoU9Dx9YAB3IjS2ABsst1gLLpL8MrYo-jaia1q0vgSOTl5mAB1oBaQAN3a1MyYunpS-vCUIFgBrUa66hubqXjUim0qZ1ZHYAAoAfQhBWGWASgQAPhraugWDA8MA2vQAHRtYBcJ7LD5vD7LBDwRDKPxfADcp3IvGyKl4cGRqLRqnU2MB21q4OgXDA-iIAGYAKxbcxkQJkGg4fAnKh2apMB5-MhUrK8CD0QgkERjKgeLzEAAcACZCrAAJyMlUfDX5XK6xkAFk5KQFzDalXUNzqCWAsQZlzU7PQpjMmKAA

Steps to Reproduce

详情请参考最小复现

Current Behavior

第二条刻度线的第一个刻度应该从第二个点开始展示

Expected Behavior

第二条刻度线的第一个刻度从第一个就开始展示了

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

sunjiesama avatar Oct 15 '24 09:10 sunjiesama

yes, looks like a bug somewhere in makeLabelsByNumericCategoryInterval. For a (weird) workaround use return (_i==0 || v=='Tue');.

helgasoft avatar Oct 15 '24 18:10 helgasoft

yes, looks like a bug somewhere in makeLabelsByNumericCategoryInterval. For a (weird) workaround use return (_i==0 || v=='Tue');.

Thank you for your answer. This method has indeed achieved what I wanted, but the first scale is still displayed. I'm thinking about it

sunjiesama avatar Oct 16 '24 01:10 sunjiesama

but the first scale is still displayed

it comes from _i==0 😄 So you either have Mon + Tue ticks, or only Mon... I said it's weird

helgasoft avatar Oct 17 '24 07:10 helgasoft

Look like a BUG in fixOnBandTicksCoords

Try return 2 tick it will be work

fixOnBandTicksCoords should return null when interval is custom function.

See :

https://echarts.apache.org/examples/zh/editor.html?c=line-smooth&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXLANprrJnmxgCeIApkQOQDGAhmPQObABONTADSVyAEw5sixJgFkYQ2EwAqAV3oKmAdXqiNSgBYqmAXREBfYVVRV0tBs3ace_ISPTiwkkkz1qN23UFFE0sbEGA8CEgYZgAjYDAwYABbVxtYYAAzTLx6MCIARgAGUKo2XDwAGQhoRgp09Dx9YAB3Iky2ABtct1gLXvL8SrZY-k6iawbMvmSOTl5mAB1oZaQANy61MyZe_vTBvCUIFgBrCd7G5rbqXjVSmxr5jfHYAAoAfQggtYBKBAA-eoNdAsGB4YCdegAOk6wC4rzWQU-3wQ8EQyj8PwA3BdyLw8ipeHA1qj0ap1LAAD6U2AktHogJMWA44F7BqQ6BcMD6IgAZgArLtzGRjKEaDh8OcqHY6kxnn4yGzcrwIPRCCQRJMqB4vMQABwAJhKsAAnLyDUETUUCpbeQAWUW9GXMTo1dT3RrJYAJHk3NTC9CmMxYoA

sz-p avatar Oct 21 '24 11:10 sz-p