Skip to content

The chart columns overflow the grid area for a stacked bar chart with logarithmic Y axis #10374

Closed

Description

@ciukstar

Version

4.2.1

Steps to reproduce

option = {
title: {
text: '对数轴示例',
left: 'center'
},
tooltip: {
trigger: 'item',
formatter: '{a}
{b} : {c}'
},
legend: {
left: 'left',
data: ['2的指数', '3的指数']
},
xAxis: {
type: 'category',
name: 'x',
splitLine: {show: false},
data: ['一', '二', '三', '四', '五', '六', '七', '八', '九']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'log',
name: 'y'
},
series: [
{
name: '3的指数',
type: 'bar',
stack: 'one',
data: [1, 3, 9, 27, 81, 247, 741, 2223, 6669],
label: {
normal: {
show: true,
position: 'insideTop'
}
}
},
{
name: '2的指数',
type: 'bar',
stack: 'one',
data: [1, 2, 4, 8, 16, 32, 64, 128, 256],
label: {
normal: {
show: true,
position: 'insideTop'
}
}
},
{
name: '1/2的指数',
type: 'bar',
stack: 'one',
data: [1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512],
label: {
normal: {
show: true,
position: 'insideTop'
}
}
}
]
}

What is expected?

Columns do not overflow

What is actually happening?

Columns overflow

Activity

  1. echarts-bot commented on Apr 27, 2019

    @echarts-bot

    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.

    Have a nice day! 🍵

  2. added
    en
    pending
    on Apr 27, 2019
  3. ciukstar commented on May 3, 2019

    @ciukstar
    Author

    stacked-col-logarithmic-y-demo

  4. qroft commented on May 3, 2019

    @qroft

    I can confirm this.
    I am having the same issue with the horizontal stacked bar.
    I have added this line to my grid so that i can see that my bar goes bigger than the grid.
    stacked-bar-bug

  5. qroft commented on May 3, 2019

    @qroft

    If i found out correctly, the chart does not calculate the maximum value of all stacked bars.
    First i added this to my xAxis
    max: 'dataMax'
    And the layout was broken again.
    Then i manually calculated the sum of all my bars and added this:
    max: 14.05

    With the latter, my stacked bar looks correct like it should.

    My temporaray solution: calculate the sum of all values in a variable and add that variable like this:
    max: myItemsSum

  6. removed
    pending
    on May 5, 2019
  7. github-actions commented on Sep 7, 2021

    @github-actions
    Contributor

    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.

  8. added
    stale
    on Sep 7, 2021
  9. github-actions commented on Sep 15, 2021

    @github-actions
    Contributor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions