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

Function getDatasetClipArea

src/helpers/helpers.dataset.ts:20–33  ·  view source on GitHub ↗
(chart: Chart, meta: ChartMeta)

Source from the content-addressed store, hash-verified

18}
19
20export function getDatasetClipArea(chart: Chart, meta: ChartMeta): TRBL | false {
21 const clip = meta._clip;
22 if (clip.disabled) {
23 return false;
24 }
25 const area = getDatasetArea(meta, chart.chartArea);
26
27 return {
28 left: clip.left === false ? 0 : area.left - (clip.left === true ? 0 : clip.left),
29 right: clip.right === false ? chart.width : area.right + (clip.right === true ? 0 : clip.right),
30 top: clip.top === false ? 0 : area.top - (clip.top === true ? 0 : clip.top),
31 bottom: clip.bottom === false ? chart.height : area.bottom + (clip.bottom === true ? 0 : clip.bottom)
32 };
33}

Callers 2

_drawDatasetMethod · 0.85
_drawfillFunction · 0.85

Calls 1

getDatasetAreaFunction · 0.85

Tested by

no test coverage detected