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

Method _getActiveElements

src/core/core.controller.js:1374–1386  ·  view source on GitHub ↗

* @param {ChartEvent} e - The event * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements * @param {boolean} inChartArea - Is the event inside chartArea * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after

(e, lastActive, inChartArea, useFinalPosition)

Source from the content-addressed store, hash-verified

1372 * @pravate
1373 */
1374 _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {
1375 if (e.type === 'mouseout') {
1376 return [];
1377 }
1378
1379 if (!inChartArea) {
1380 // Outside chartArea, the elements set by code stay (eg. by a legend onHover), and the pointer's end.
1381 return this._activeSetByCode ? lastActive : [];
1382 }
1383
1384 const hoverOptions = this.options.hover;
1385 return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);
1386 }
1387}
1388
1389// @ts-ignore

Callers 1

_handleEventMethod · 0.95

Calls 1

Tested by

no test coverage detected