diff --git a/src/data/helper/dataStackHelper.js b/src/data/helper/dataStackHelper.js index e470edc2bd942f9523297cdfac313bcac5d59f29..d0c9145a8bdee65d64c9ee06ce09da246b764ee9 100644 --- a/src/data/helper/dataStackHelper.js +++ b/src/data/helper/dataStackHelper.js @@ -72,10 +72,16 @@ export function enableDataStack(seriesModel, dimensionInfoList, opt) { } }); + if (stackedDimInfo && !byIndex && !stackedByDimInfo) { + // Compatible with previous design, value axis (time axis) only stack by index. + // It may make sense if the user provides elaborately constructed data. + byIndex = true; + } + // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. // That put stack logic in List is for using conveniently in echarts extensions, but it // might not be a good way. - if (stackedDimInfo && (byIndex || stackedByDimInfo)) { + if (stackedDimInfo) { // Use a weird name that not duplicated with other names. stackResultDimension = '__\0ecstackresult'; stackedOverDimension = '__\0ecstackedover'; diff --git a/test/area-stack.html b/test/area-stack.html index bfef3a157a616b2615b44bfae67c4a67ca507211..7d2b9ab6627d6bdb7cbcc284520c8a9a5b1e3f07 100644 --- a/test/area-stack.html +++ b/test/area-stack.html @@ -19,7 +19,7 @@
- +
@@ -400,5 +400,165 @@ + + + + + + + + + + + + + + \ No newline at end of file