You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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
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
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: