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

Method getCenterPoint

src/elements/element.bar.js:215–221  ·  view source on GitHub ↗
(useFinalPosition)

Source from the content-addressed store, hash-verified

213 }
214
215 getCenterPoint(useFinalPosition) {
216 const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));
217 return {
218 x: horizontal ? (x + base) / 2 : x,
219 y: horizontal ? y : (y + base) / 2
220 };
221 }
222
223 getRange(axis) {
224 return axis === 'x' ? this.width / 2 : this.height / 2;

Callers

nothing calls this directly

Calls 1

getPropsMethod · 0.80

Tested by

no test coverage detected