Skip to content

Commit 6899539

Browse files
committed
fix stacked scatter for groupby traces
1 parent a4c185a commit 6899539

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/traces/scatter/calc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ function calc(gd, trace) {
3838
var yAttr = 'y';
3939
var posAttr;
4040
if(stackGroupOpts) {
41-
stackGroupOpts.traceIndices.push(trace.index);
41+
Lib.pushUnique(stackGroupOpts.traceIndices, trace._expandedIndex);
4242
isV = stackGroupOpts.orientation === 'v';
43+
4344
// size, like we use for bar
4445
if(isV) {
4546
yAttr = 's';
16.6 KB
Loading
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"data": [
3+
{
4+
"x": [ 1, 1, 2, 2, 3, 3 ],
5+
"y": [ 1, 1, 2, 2, 3, 3 ],
6+
"stackgroup": 1,
7+
"transforms": [
8+
{
9+
"type": "groupby",
10+
"groups": [ "a", "b", "a", "b", "a", "b" ]
11+
}
12+
]
13+
}
14+
],
15+
"layout": {
16+
"width": 400
17+
}
18+
}

0 commit comments

Comments
 (0)