@@ -54,7 +54,10 @@ function setGroupPositions(gd, pa, sa, traces) {
54
54
55
55
var barmode = gd . _fullLayout . barmode ,
56
56
overlay = ( barmode === 'overlay' ) ,
57
- group = ( barmode === 'group' ) ;
57
+ group = ( barmode === 'group' ) ,
58
+ excluded ,
59
+ included ,
60
+ i , trace ;
58
61
59
62
if ( overlay ) {
60
63
setGroupPositionsInOverlayMode ( gd , pa , sa , traces ) ;
@@ -63,7 +66,21 @@ function setGroupPositions(gd, pa, sa, traces) {
63
66
setGroupPositionsInGroupMode ( gd , pa , sa , traces ) ;
64
67
}
65
68
else {
66
- setGroupPositionsInStackOrRelativeMode ( gd , pa , sa , traces ) ;
69
+ // exclude from the stack those traces for which the user set a base
70
+ excluded = [ ] ;
71
+ included = [ ] ;
72
+ for ( i = 0 ; i < traces . length ; i ++ ) {
73
+ trace = traces [ i ] ;
74
+ if ( trace . base === undefined ) included . push ( trace ) ;
75
+ else excluded . push ( trace ) ;
76
+ }
77
+
78
+ if ( included . length ) {
79
+ setGroupPositionsInStackOrRelativeMode ( gd , pa , sa , included ) ;
80
+ }
81
+ if ( excluded . length ) {
82
+ setGroupPositionsInOverlayMode ( gd , pa , sa , excluded ) ;
83
+ }
67
84
}
68
85
}
69
86
0 commit comments