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

Method getPixelForTick

src/core/core.scale.js:914–920  ·  view source on GitHub ↗

* Returns the location of the tick at the given index * The coordinate (0, 0) is at the upper-left corner of the canvas * @param {number} index * @return {number}

(index)

Source from the content-addressed store, hash-verified

912 * @return {number}
913 */
914 getPixelForTick(index) {
915 const ticks = this.ticks;
916 if (index < 0 || index > ticks.length - 1) {
917 return null;
918 }
919 return this.getPixelForValue(ticks[index].value);
920 }
921
922 /**
923 * Utility for getting the pixel location of a percentage of scale

Callers 2

_calculatePaddingMethod · 0.95
_computeLabelItemsMethod · 0.95

Calls 1

getPixelForValueMethod · 0.95

Tested by

no test coverage detected