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

Clipping the bar outside of the grid #13321

Closed
Remy-J opened this issue Sep 21, 2020 · 8 comments
Closed

Clipping the bar outside of the grid #13321

Remy-J opened this issue Sep 21, 2020 · 8 comments
Labels
en This issue is in English enhancement stale Inactive for a long time. Will be closed in 7 days. topic: bar waiting-for: community

Comments

@Remy-J
Copy link

Remy-J commented Sep 21, 2020

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

@echarts-bot
Copy link

echarts-bot bot commented Sep 21, 2020

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 dev@echarts.apache.org. 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! 🍵

@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 Sep 21, 2020
@pissang
Copy link
Contributor

pissang commented Sep 27, 2020

You can specify the width of bar

@pissang pissang removed pending We are not sure about whether this is a bug/new feature. waiting-for: community bug labels Sep 27, 2020
@Remy-J
Copy link
Author

Remy-J commented Sep 29, 2020

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

@Ovilia
Copy link
Contributor

Ovilia commented Oct 9, 2020

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.

@Ovilia Ovilia changed the title when i use xAxis.type equal value the layout is broken Clipping the bar outside of the grid Oct 9, 2020
@Remy-J
Copy link
Author

Remy-J commented Oct 12, 2020

Hi, thank you for your reply

@Remy-J
Copy link
Author

Remy-J commented Feb 16, 2021

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

@github-actions
Copy link
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.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Feb 16, 2023
@github-actions
Copy link
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
Labels
en This issue is in English enhancement stale Inactive for a long time. Will be closed in 7 days. topic: bar waiting-for: community
Projects
None yet
Development

No branches or pull requests

3 participants