diff --git a/src/traces/scatter/calc.js b/src/traces/scatter/calc.js index 7657b790d48..28f6f16db70 100644 --- a/src/traces/scatter/calc.js +++ b/src/traces/scatter/calc.js @@ -38,8 +38,9 @@ function calc(gd, trace) { var yAttr = 'y'; var posAttr; if(stackGroupOpts) { - stackGroupOpts.traceIndices.push(trace.index); + Lib.pushUnique(stackGroupOpts.traceIndices, trace._expandedIndex); isV = stackGroupOpts.orientation === 'v'; + // size, like we use for bar if(isV) { yAttr = 's'; diff --git a/test/image/baselines/stacked_area_groupby.png b/test/image/baselines/stacked_area_groupby.png new file mode 100644 index 00000000000..bcdd0536180 Binary files /dev/null and b/test/image/baselines/stacked_area_groupby.png differ diff --git a/test/image/mocks/stacked_area_groupby.json b/test/image/mocks/stacked_area_groupby.json new file mode 100644 index 00000000000..62bb8a97bfd --- /dev/null +++ b/test/image/mocks/stacked_area_groupby.json @@ -0,0 +1,18 @@ +{ + "data": [ + { + "x": [ 1, 1, 2, 2, 3, 3 ], + "y": [ 1, 1, 2, 2, 3, 3 ], + "stackgroup": 1, + "transforms": [ + { + "type": "groupby", + "groups": [ "a", "b", "a", "b", "a", "b" ] + } + ] + } + ], + "layout": { + "width": 400 + } +}