MCPcopy
hub / github.com/chartjs/Chart.js / _getTargetPixel

Function _getTargetPixel

src/plugins/plugin.filler/filler.options.js:80–93  ·  view source on GitHub ↗
(fill, scale)

Source from the content-addressed store, hash-verified

78 * @returns {number | null}
79 */
80export function _getTargetPixel(fill, scale) {
81 let pixel = null;
82 if (fill === 'start') {
83 pixel = scale.bottom;
84 } else if (fill === 'end') {
85 pixel = scale.top;
86 } else if (isObject(fill)) {
87 // @ts-ignore
88 pixel = scale.getPixelForValue(fill.value);
89 } else if (scale.getBasePixel) {
90 pixel = scale.getBasePixel();
91 }
92 return pixel;
93}
94
95/**
96 * @param {FillTarget | ComplexFillTarget} fill

Callers 1

computeLinearBoundaryFunction · 0.90

Calls 3

isObjectFunction · 0.85
getPixelForValueMethod · 0.65
getBasePixelMethod · 0.65

Tested by

no test coverage detected