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

Method bindUserEvents

src/core/core.controller.js:1059–1075  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

1057 * @private
1058 */
1059 bindUserEvents() {
1060 const listeners = this._listeners;
1061 const platform = this.platform;
1062
1063 const _add = (type, listener) => {
1064 platform.addEventListener(this, type, listener);
1065 listeners[type] = listener;
1066 };
1067
1068 const listener = (e, x, y) => {
1069 e.offsetX = x;
1070 e.offsetY = y;
1071 this._eventHandler(e);
1072 };
1073
1074 each(this.options.events, (type) => _add(type, listener));
1075 }
1076
1077 /**
1078 * @private

Callers 1

bindEventsMethod · 0.95

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected