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

Method getPixelForTick

src/core/core.scale.js:906–912  ·  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

904 * @return {number}
905 */
906 getPixelForTick(index) {
907 const ticks = this.ticks;
908 if (index < 0 || index > ticks.length - 1) {
909 return null;
910 }
911 return this.getPixelForValue(ticks[index].value);
912 }
913
914 /**
915 * 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