Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Inconsistent xAxis axisTick #20726

Open
zemmyang opened this issue Jan 30, 2025 · 1 comment
Open

[Bug] Inconsistent xAxis axisTick #20726

zemmyang opened this issue Jan 30, 2025 · 1 comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@zemmyang
Copy link

Version

5.6.0

Link to Minimal Reproduction

https://jsfiddle.net/mk3dzp49/

Steps to Reproduce

Chart is a simple line plot with a grid, with the x-axis defined as follows:

      xAxis: {
        "type": "value",
        "minorTick": {
            "show": "true",
            "splitNumber": 5
        },
        "minorSplitLine": {
            "show": "true"
        },
        "axisLabel": {
            "show": "true"
        },
        "axisTick": {
            "customValues": vTickData
        },
        "splitLine": {
            "show": "true",
            "lineStyle": {
                "color": '#ff0000',
                "type": 'solid',
                "width": 1
            }
        },
      },

Current Behavior

The thin red vertical lines appear to be randomly placed.

Image

Expected Behavior

I want to have one thick red line for every 5 thin red lines, for example. But that doesn't appear to be what's going on here. Instead I get several thick lines and thin lines placed at random.

y-axis lines don't appear to have the same issue.

Environment

- OS: Win 11
- Browser: Chrome
- Framework: None?

Any additional comments?

No response

@zemmyang zemmyang added the bug label Jan 30, 2025
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jan 30, 2025
@MatthiasMert
Copy link

As per documentation minorTick.splitNumber revers to the number of intervals, not the number of minorTicks / splitLines. The documentation does not specify what exactly is split tho. It seems to be the interval between two labels (which is not neccessarily equal to the interval between two ticks).

If you align ticks and axisLabel it should work as expected: Example

If you need specific tick intervals you can control them with interval, minInterval and maxInterval: Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants