Skip to content

Commit 54ac1f1

Browse files
committed
bar: Add attributes base, offset and width
1 parent b25467b commit 54ac1f1

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/traces/bar/attributes.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,41 @@ module.exports = {
4848
].join(' ')
4949
},
5050

51+
base: {
52+
valType: 'any',
53+
arrayOk: true,
54+
role: 'info',
55+
description: [
56+
'Sets where the bar base is drawn (in position axis units).',
57+
'In *stack* or *relative* barmode,',
58+
'traces that set *base* will be excluded',
59+
'and drawn in *overlay* mode instead.'
60+
].join(' ')
61+
},
62+
63+
offset: {
64+
valType: 'number',
65+
arrayOk: true,
66+
role: 'info',
67+
description: [
68+
'Shifts the position where the bar is drawn',
69+
'(in position axis units).',
70+
'In *group* barmode,',
71+
'traces that set *offset* will be excluded',
72+
'and drawn in *overlay* mode instead.'
73+
].join(' ')
74+
},
75+
76+
width: {
77+
valType: 'number',
78+
min: 0,
79+
arrayOk: true,
80+
role: 'info',
81+
description: [
82+
'Sets the bar width (in position axis units).'
83+
].join(' ')
84+
},
85+
5186
marker: marker,
5287

5388
r: scatterAttrs.r,

src/traces/bar/defaults.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3030
}
3131

3232
coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');
33+
coerce('base');
34+
coerce('offset');
35+
coerce('width');
3336
coerce('text');
3437

3538
handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);

0 commit comments

Comments
 (0)