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

Method bindUserEvents

src/core/core.controller.js:976–992  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

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

Callers 1

bindEventsMethod · 0.95

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected