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

Bar series overflow xAxis when using xAxis.scale = true with several series #15189

Open
deterralba opened this issue Jun 18, 2021 · 4 comments
Open
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@deterralba
Copy link

Version

5.1.2

Reproduction link

https://jsfiddle.net/9p4j6175/

Steps to reproduce

option = {
  "xAxis": {
    // min": 10,
    scale: true,
  },
  "yAxis": { },
  "series": [
    {
      "id": "F",
      "data": [
        [20,1],
        [35,2],
        [55,7],
    ],
      "type": "bar",
    },
    {
      "id": "M",
      "data": [
        [20,1],
        [35,2],
        [55,7],
      ],
      "type": "bar",
    }
  ]
}

What is expected?

The bars are not going at the left side of the xAxis for the lowest value.
We could add a option to add "extra security margins", scale: {margin: '10%'} could be a solution.
image

What is actually happening?

The bars are on the left side of the xAxis for the lowest value.
image

@echarts-bot
Copy link

echarts-bot bot commented Jun 18, 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 it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

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 dev@echarts.apache.org. 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 Jun 18, 2021
@100pah
Copy link
Member

100pah commented Jun 27, 2021

Does boundaryGap help?

@helgasoft
Copy link

helgasoft commented Aug 10, 2021

@100pah - no, boundaryGap does not help yes, boundaryGap helps.
Looks like the bug is related to number of bars. Four or less bars with scale:true will overflow Xaxis. More than four will display correctly.

option = {
  "xAxis": { scale: true
       // ,boundaryGap: ['10%', '10%']    // workaround
   },
  "yAxis": {},
  "series": [ { "type": "bar" } ],
  "dataset": [{
      "source": [
        ["x", "y"],
        [  25000, 4  ],
        [  35000, 14 ],
        [  45000, 10 ],
        [  55000, 4  ],
//        [  66000, 1  ]   // un-comment to see difference
      ]
    }]
}

May be related to #13321.

@dimer47
Copy link

dimer47 commented Dec 2, 2022

I had the same problem, thank you very much @helgasoft !
The xAxis scale:true option works perfectly.

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

4 participants