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

Method getPixelForDecimal

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

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

Callers

nothing calls this directly

Calls 2

_int16RangeFunction · 0.85
_alignPixelFunction · 0.85

Tested by

no test coverage detected