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

Method getMatchingVisibleMetas

src/core/core.scale.js:1685–1698  ·  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

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

Callers 2

getMinMaxMethod · 0.95
_isVisibleMethod · 0.95

Calls 1

Tested by

no test coverage detected