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

Method _getActiveElements

src/core/core.controller.js:1253–1265  ·  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

1251 * @pravate
1252 */
1253 _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {
1254 if (e.type === 'mouseout') {
1255 return [];
1256 }
1257
1258 if (!inChartArea) {
1259 // Let user control the active elements outside chartArea. Eg. using Legend.
1260 return lastActive;
1261 }
1262
1263 const hoverOptions = this.options.hover;
1264 return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);
1265 }
1266}
1267
1268// @ts-ignore

Callers 1

_handleEventMethod · 0.95

Calls 1

Tested by

no test coverage detected