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

Method getPixelForDecimal

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

* Utility for getting the pixel location of a percentage of scale * The coordinate (0, 0) is at the upper-left corner of the canvas * @param {number} decimal * @return {number}

(decimal)

Source from the content-addressed store, hash-verified

918 * @return {number}
919 */
920 getPixelForDecimal(decimal) {
921 if (this._reversePixels) {
922 decimal = 1 - decimal;
923 }
924
925 const pixel = this._startPixel + decimal * this._length;
926 return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);
927 }
928
929 /**
930 * @param {number} pixel

Callers

nothing calls this directly

Calls 2

_int16RangeFunction · 0.85
_alignPixelFunction · 0.85

Tested by

no test coverage detected