mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 00:14:03 +01:00
* enable esnext and fix all lint errors * Review update * Missed some * Some cleanup still * Remove leftover eslint disable
33 lines
506 B
JavaScript
33 lines
506 B
JavaScript
import {extend, inherits} from '../helpers/helpers.core';
|
|
import {isNumber} from '../helpers/helpers.math';
|
|
|
|
class Element {
|
|
|
|
/**
|
|
* @param {object} [cfg] optional configuration
|
|
*/
|
|
constructor(cfg) {
|
|
this.x = undefined;
|
|
this.y = undefined;
|
|
this.hidden = undefined;
|
|
|
|
if (cfg) {
|
|
extend(this, cfg);
|
|
}
|
|
}
|
|
|
|
tooltipPosition() {
|
|
return {
|
|
x: this.x,
|
|
y: this.y
|
|
};
|
|
}
|
|
|
|
hasValue() {
|
|
return isNumber(this.x) && isNumber(this.y);
|
|
}
|
|
}
|
|
|
|
Element.extend = inherits;
|
|
export default Element;
|