echarts
echarts copied to clipboard
Stacked Area incorrect with xAxis of type=value
问题简述 (One-line summary)
Stacked Area incorrect with xAxis of type=value
版本及环境 (Version & Environment)
- ECharts 版本 (ECharts version): 3.2.3
- 浏览器类型和版本 (Browser version): Chrome 53
- 操作系统类型和版本 (OS Version): OSX Yosemite
重现步骤 (Steps to reproduce)
- The "option" (below) will produce a CORRECT Area chart based on two value axis:

- However, if you change
group2togroup1, so that the two series' stack names match, then they do not stack properly and it looks like the following:

期望结果 (Expected behaviour)
The areas should stack properly but they don't.
可能哪里有问题 (What went wrong)
I think echarts might be adding up the "x" values (in the series data) for the stack, when it makes sense to add up the "y" values instead, maybe?
I am trying to create a 'market depth' chart that looks like the following, but with an added layer stacked within. Grateful for any advice or examples:

ECharts配置项 (ECharts option)
let options = {
tooltip : {
trigger: 'axis'
},
legend: {
data:['Orders','Ghost Orders']
},
xAxis : [
{
type : 'value',
scale: true
}
],
yAxis : [
{
type : 'value',
scale: true
}
],
series : [
{
name:'Orders',
type:'line',
stack: 'group1',
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data: [
[
0.0189,
45
],
[
0.019,
96
],
[
0.0191,
85
],
[
0.0192,
50
],
[
0.0193,
2
],
[
0.0194,
14
],
[
0.0195,
79
]
]
},
{
name:'Ghost Orders',
type:'line',
stack: 'group2',
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[
[
0.0189,
26
],
[
0.019,
33
],
[
0.0191,
58
],
[
0.019200000000000002,
45
],
[
0.0193,
94
],
[
0.0194,
30
],
[
0.0195,
52
]
]
}
]
};
其他信息 (Other comments)
Thanks a lot for this fantastic chart library!
Hi @mrcybermac, Glad to hear you like it:)
We didn't consider the two value axis situation when we design the stack property. It is mostly used in the category axis. Thanks for the feedback and we will try to enhance it