Skip to content

Commit 68fae33

Browse files
committed
Ensure offsetIndex and offsetgroup are not undefined
1 parent 8caa69b commit 68fae33

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/traces/bar/cross_trace_calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function setOffsetAndWidth(gd, pa, sieve, opts) {
352352

353353
var t = calcTrace[0].t;
354354
t.barwidth = barWidth;
355-
t.offsetindex = trace._offsetIndex;
355+
t.offsetindex = trace._offsetIndex || 0;
356356
t.poffset = offsetFromCenter;
357357
t.bargroupwidth = barGroupWidth;
358358
t.bardelta = minDiff;

src/traces/scatter/grouping_defaults.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ module.exports = function handleGroupingDefaults(traceIn, traceOut, fullLayout,
2626
};
2727
}
2828

29-
var offsetgroup = coerce('offsetgroup');
29+
var offsetgroup = coerce('offsetgroup') || '';
3030
var offsetGroups = alignmentGroupOpts.offsetGroups;
3131
var offsetGroupOpts = offsetGroups[offsetgroup];
3232
// in barmode 'group', traces without offsetgroup receive their own offsetgroup
3333
// in other barmodes, traces without offsetgroup are assigned to the same offset group
34+
traceOut._offsetIndex = 0;
3435
if(barmode !== 'group' || offsetgroup) {
3536
if(!offsetGroupOpts) {
3637
offsetGroupOpts = offsetGroups[offsetgroup] = {

0 commit comments

Comments
 (0)