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

Method buildTicks

docs/scripts/log2.js:21–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 }
20
21 buildTicks() {
22 const ticks = [];
23
24 let power = Math.floor(Math.log2(this.min || 1));
25 let maxPower = Math.ceil(Math.log2(this.max || 2));
26 while (power <= maxPower) {
27 ticks.push({value: Math.pow(2, power)});
28 power += 1;
29 }
30
31 this.min = ticks[0].value;
32 this.max = ticks[ticks.length - 1].value;
33 return ticks;
34 }
35
36 /**
37 * @protected

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected