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

xAxis Label Overlap #14528

Closed
dyoon-linevision opened this issue Mar 24, 2021 · 12 comments
Closed

xAxis Label Overlap #14528

dyoon-linevision opened this issue Mar 24, 2021 · 12 comments
Labels
bug en This issue is in English stale Inactive for a long time. Will be closed in 7 days. topic: axis-time topic: label

Comments

@dyoon-linevision
Copy link

dyoon-linevision commented Mar 24, 2021

Using v4.7.0:
Screen Shot 2021-03-24 at 4 07 37 PM

After upgrading to v5.0.2:
Screen Shot 2021-03-24 at 4 06 11 PM

Version

5.0.2

Steps to reproduce

  • Upgrade to eCharts 5.0.2

  • Use the following options for xAxis:

options.xAxis.push({
      gridIndex: ndx,
      type: 'time',
      axisLabel: {
            formatter: function (date, index) {
                  return DateTime.dateFormat(new Date(date), true)
            },
            showMaxLabel: false
      },
});

What is expected?

Expect the xAxis intervals to be spread out far enough so that the labels don't overlap.

What is actually happening?

After upgrading to eCharts v5, the labels now overlap. The chart options did not change.

@echarts-bot
Copy link

echarts-bot bot commented Mar 24, 2021

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Mar 24, 2021
@plainheart
Copy link
Member

Thanks for your feedback. This is related to #13682 and #14266. It will probably be fixed in v5.1.0 or v5.2.0.

@plainheart plainheart added topic: axis-time topic: label and removed pending We are not sure about whether this is a bug/new feature. labels Mar 25, 2021
@JesperBalslev
Copy link

Any news?

@tomazk8
Copy link

tomazk8 commented Sep 2, 2021

Any more news? I have the same problem. I noticed that axis ticks are also irregularly placed which should not happen. I am using version 5.1.2. Custom formatter is used to generate the axis labels.
image

@plainheart
Copy link
Member

@tomazk8 #15583 may fix this bug. But it was just merged and not released yet. It's planned in v5.2.1.

@tomazk8
Copy link

tomazk8 commented Sep 2, 2021

@plainheart Thanks a lot. I am anxiously waiting for the new version :). Do you already know when it'll be released?

@hannata
Copy link

hannata commented Jan 11, 2022

when will it be fixed ? I'm using the v5.2.2 and it still overlaps

@tomazk8
Copy link

tomazk8 commented Jan 12, 2022

For us it works now with version 5.2.2 - well, sort of. What axis does now is that it simply hides the ones that overlap. It should rearange the layout of the axis instead because the result is not that good as it could be. The axis layout algorithm is in general implemented badly. I know that the problem is that you cannot calculate the tick positions directly because in order to check if two labels overlap, you already need the tick positions. I have implemented such an algorithm long time ago where I roughly estimated the tick positions, checked if texts overlap and if yes, increase the tick offset and continue until I got the correct positions. It usually took only a couple of cycles and produced perfect result.

@Wintermute79
Copy link

Wintermute79 commented Jan 19, 2022

I had the same issue with 5.2.2 when using label type 'time'. For me it was fixed with setting xAxis.axisLabel.hideOverlap to true.

@Wintermute79
Copy link

I had the same issue with 5.2.2 when using label type 'time'. For me it was fixed with setting xAxis.axisLabel.hideOverlap to true.

Tip: if you have axis labels of different lengths (e.g. weekday names), pad the ends with spaces to the same length to get better results.

Copy link
Contributor

github-actions bot commented Feb 2, 2024

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Feb 2, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
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 stale Inactive for a long time. Will be closed in 7 days. topic: axis-time topic: label
Projects
None yet
Development

No branches or pull requests

6 participants