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

Method bindUserEvents

src/core/core.controller.js:980–996  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

978 * @private
979 */
980 bindUserEvents() {
981 const listeners = this._listeners;
982 const platform = this.platform;
983
984 const _add = (type, listener) => {
985 platform.addEventListener(this, type, listener);
986 listeners[type] = listener;
987 };
988
989 const listener = (e, x, y) => {
990 e.offsetX = x;
991 e.offsetY = y;
992 this._eventHandler(e);
993 };
994
995 each(this.options.events, (type) => _add(type, listener));
996 }
997
998 /**
999 * @private

Callers 1

bindEventsMethod · 0.95

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected