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

[Bug] xAxis.type='value'时,type=‘bar'的stack无法堆叠 #16656

Open
wokanbudongyinwen opened this issue Mar 9, 2022 · 2 comments
Open
Labels
bug pending We are not sure about whether this is a bug/new feature. waiting-for: community

Comments

@wokanbudongyinwen
Copy link

Version

5.2.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=bar-label-rotation

Steps to Reproduce

const posList = [
'left',
'right',
'top',
'bottom',
'inside',
'insideTop',
'insideLeft',
'insideRight',
'insideBottom',
'insideTopLeft',
'insideTopRight',
'insideBottomLeft',
'insideBottomRight'
];
app.configParameters = {
rotate: {
min: -90,
max: 90
},
align: {
options: {
left: 'left',
center: 'center',
right: 'right'
}
},
verticalAlign: {
options: {
top: 'top',
middle: 'middle',
bottom: 'bottom'
}
},
position: {
options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {})
},
distance: {
min: 0,
max: 100
}
};
app.config = {
rotate: 90,
align: 'left',
verticalAlign: 'middle',
position: 'insideBottom',
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance
};
myChart.setOption({
series: [
{
label: labelOption
},
{
label: labelOption
},
{
label: labelOption
},
{
label: labelOption
}
]
});
}
};
const labelOption = {
show: true,
position: app.config.position,
distance: app.config.distance,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
rotate: app.config.rotate,
formatter: '{c} {name|{a}}',
fontSize: 16,
rich: {
name: {}
}
};
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['Forest', 'Steppe', 'Desert', 'Wetland']
},
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar', 'stack'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
xAxis: [
{
type: 'value',
axisTick: { show: false },
min:-3,
max:3,
scale:true
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'Forest',
type: 'bar',
stack: '总量',
label: labelOption,
emphasis: {
focus: 'series'
},
data: [[-2,320], [-1,332], [1,301],[2,334], [3,390]]
},
{
name: 'Steppe',
type: 'bar',
stack: '总量',
label: labelOption,
emphasis: {
focus: 'series'
},
data: [[-2,220], [-1,332], [1,301],[2,334], [3,390]]
},
{
name: 'Desert',
type: 'bar',
stack: '总量',
label: labelOption,
emphasis: {
focus: 'series'
},
data: [[-2,120], [-1,332], [1,301],[2,334], [3,390]]
},
{
name: 'Wetland',
type: 'bar',
stack: '总量',
label: labelOption,
emphasis: {
focus: 'series'
},
data: [[-2,120], [-1,332], [1,301],[2,334], [3,390]]
}
]
};

这是用官方示例改写的一个demo,当粗体的部分如上设置时,柱状图无法堆叠。当 xAxis.type='category'时,柱状图正常堆叠。

Current Behavior

我在改写上面的demo时,当xAxis.type='value,且为柱状图设置stack,柱状图无法堆叠。当 xAxis.type='category'时,柱状图正常堆叠。

Expected Behavior

柱状图可以正常堆叠

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@echarts-bot echarts-bot bot added pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Mar 9, 2022
@echarts-bot
Copy link

echarts-bot bot commented Mar 9, 2022

@wokanbudongyinwen It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] When xAxis.type='value', the stack of type='bar' cannot be stacked

@helgasoft
Copy link

similar to #16765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pending We are not sure about whether this is a bug/new feature. waiting-for: community
Projects
None yet
Development

No branches or pull requests

2 participants