MCPcopy Create free account
hub / github.com/chartjs/Chart.js / parseFillOption

Function parseFillOption

src/plugins/plugin.filler/filler.options.ts:101–119  ·  view source on GitHub ↗
(line: LineElement)

Source from the content-addressed store, hash-verified

99}
100
101function parseFillOption(line: LineElement) {
102 // `fill` is a number, a string, a boolean or an object, told apart at runtime here and in `_decodeFill`
103 const options: AnyObject = line.options;
104 const fillOption = options.fill;
105 let fill = valueOrDefault(fillOption && fillOption.target, fillOption);
106
107 if (fill === undefined) {
108 fill = !!options.backgroundColor;
109 }
110
111 if (fill === false || fill === null) {
112 return false;
113 }
114
115 if (fill === true) {
116 return 'origin';
117 }
118 return fill;
119}

Callers 1

_decodeFillFunction · 0.85

Calls 1

valueOrDefaultFunction · 0.85

Tested by

no test coverage detected