Skip to content

Clipping the bar outside of the grid #13321

Closed

Description

@Remy-J

Version

4.6.0

Reproduction link

https://gallery.echartsjs.com/editor.html?c=xs9BT4SnHR&v=1

Steps to reproduce

use this conf:

option = {
    legend: {},
    tooltip: {},
    dataset: {
        source: [
            ['val', 'id'],
            [0, 1234],
            [4, 12345]
        ]
    },
    xAxis: {type: 'value'},
    yAxis: {},
    series: [
        {type: 'bar'}
    ]
};

What is expected?

the graph is expected to be consistent

What is actually happening?

the layout is broken.
the columns come out of the graph and their size is not good

Activity

  1. echarts-bot commented on Sep 21, 2020

    @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.

    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 questions.

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

    Have a nice day! 🍵

  2. added
    en
    pending
    on Sep 21, 2020
  3. pissang commented on Sep 27, 2020

    @pissang
    Contributor

    You can specify the width of bar

  4. removed
    pending
    on Sep 27, 2020
  5. Remy-J commented on Sep 29, 2020

    @Remy-J
    Author

    thanks for your feedback but even by reducing the width of the bars when zooming the layout is broken

    use this cofig: option = {
    dataZoom: [{ type: 'inside' }],
    grid: { bottom: 40, left: 70, right: 50, top: 30 },
    series: [
    {
    barWidth: '10%',
    data: [
    ['val', 'id'],
    [0, 377146],
    [1, 620432],
    ],
    name: 'id',
    type: 'bar',
    },
    ],
    toolbox: {
    feature: {
    dataZoom: { title: { back: 'Zoom Reset', zoom: 'Zoom' } },
    },
    magicType: {
    show: false,
    title: {
    bar: 'Switch to Bar Chart',
    line: 'Switch to Line Chart',
    stack: 'Stack',
    tiled: 'Tile',
    },
    type: [],
    },

    saveAsImage: { title: 'Save image' },
    
    show: false,
    

    },
    tooltip: { axisPointer: { type: 'shadow' }, trigger: 'axis' },

    xAxis: {
    axisLabel: {
    rotate: 0,
    },
    axisLine: {
    lineStyle: {
    color: '#656565',
    },
    },

    boundaryGap: ['20%', '20%'],
    max: 2,
    min: -1,
    scale: true,
    
    splitLine: {
      lineStyle: {
        color: '#DDD',
        type: 'dashed',
      },
    },
    
    type: 'value',
    

    },
    yAxis: {
    axisLine: {
    onZero: false,
    },
    scale: false,

    splitLine: {
      lineStyle: { color: '#DDD', type: 'dashed' },
    },
    

    },
    };

    here is a link where you can test:
    https://gallery.echartsjs.com/editor.html?c=xs9BT4SnHR&v=3

    place your mouse to the right of the first bar and zoom step by step and you will see the outdated bar of the y-axis

    here is a link where you can see the result:
    https://zupimages.net/viewer.php?id=20/40/vs3s.png

  6. Ovilia commented on Oct 9, 2020

    @Ovilia
    Contributor

    Hi, this is the expected behavior for now. Bars will be only clipped (display nothing) when all of the bar are outside of the grid area. There's no way to clip the part outside of the grid for now but it may be supported afterwards.

  7. changed the title [-]when i use xAxis.type equal value the layout is broken [/-] [+]Clipping the bar outside of the grid[/+] on Oct 9, 2020
  8. Remy-J commented on Oct 12, 2020

    @Remy-J
    Author

    Hi, thank you for your reply

  9. Remy-J commented on Feb 16, 2021

    @Remy-J
    Author

    hello I would like to know if you have been able to make any progress on this issue.

  10. added a commit that references this issue on Aug 28, 2021
    047beee
  11. added a commit that references this issue on Sep 27, 2021
    5e8e96c
  12. github-actions commented on Feb 16, 2023

    @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.

  13. added
    stale
    on Feb 16, 2023
  14. github-actions commented on Feb 23, 2023

    @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!

  15. added a commit that references this issue on Mar 15, 2026
    fe932a2
  16. 100pah commented on May 14, 2026

    @100pah
    Member

    Fix in v6.1.0

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

    enenhancementstaletopic: bar

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions