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

Function keepZero

src/helpers/helpers.options.ts:189–189  ·  view source on GitHub ↗
(value: number, add: number)

Source from the content-addressed store, hash-verified

187 const {min, max} = minmax;
188 const change = toDimension(grace, (max - min) / 2);
189 const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;
190 return {
191 min: keepZero(min, -Math.abs(change)),
192 max: keepZero(max, change)

Callers 1

_addGraceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected