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

Method getMatchingVisibleMetas

src/core/core.scale.js:1678–1691  ·  view source on GitHub ↗

* Returns visible dataset metas that are attached to this scale * @param {string} [type] - if specified, also filter by dataset type * @return {object[]}

(type)

Source from the content-addressed store, hash-verified

1676 * @return {object[]}
1677 */
1678 getMatchingVisibleMetas(type) {
1679 const metas = this.chart.getSortedVisibleDatasetMetas();
1680 const axisID = this.axis + 'AxisID';
1681 const result = [];
1682 let i, ilen;
1683
1684 for (i = 0, ilen = metas.length; i < ilen; ++i) {
1685 const meta = metas[i];
1686 if (meta[axisID] === this.id && (!type || meta.type === type)) {
1687 result.push(meta);
1688 }
1689 }
1690 return result;
1691 }
1692
1693 /**
1694 * @param {number} index

Callers 2

getMinMaxMethod · 0.95
_isVisibleMethod · 0.95

Calls 1

Tested by

no test coverage detected