Skip to content

Commit 34759f3

Browse files
committed
makeFillcolorAttr function with hasFillgradient option
1 parent 4c56fa8 commit 34759f3

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/traces/scatter/attributes.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ var constants = require('./constants');
1313

1414
var extendFlat = require('../../lib/extend').extendFlat;
1515

16+
var makeFillcolorAttr = function(hasFillgradient) {
17+
return {
18+
valType: 'color',
19+
editType: 'style',
20+
anim: true,
21+
description: [
22+
'Sets the fill color.',
23+
'Defaults to a half-transparent variant of the line color,',
24+
'marker color, or marker line color, whichever is available.',
25+
hasFillgradient ?
26+
'If fillgradient is specified, fillcolor is ignored except for setting the background color of the hover label, if any.' :
27+
''
28+
].join(' ')
29+
};
30+
}
31+
1632
function axisPeriod(axis) {
1733
return {
1834
valType: 'any',
@@ -391,18 +407,7 @@ module.exports = {
391407
'consecutive, the later ones will be pushed down in the drawing order.'
392408
].join(' ')
393409
},
394-
fillcolor: {
395-
valType: 'color',
396-
editType: 'style',
397-
anim: true,
398-
description: [
399-
'Sets the fill color.',
400-
'Defaults to a half-transparent variant of the line color,',
401-
'marker color, or marker line color, whichever is available.',
402-
'If fillgradient is specified, fillcolor is ignored except for',
403-
'setting the background color of the hover label, if any.'
404-
].join(' ')
405-
},
410+
fillcolor: makeFillcolorAttr(true),
406411
fillgradient: extendFlat({
407412
type: {
408413
valType: 'enumerated',

0 commit comments

Comments
 (0)