MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / skip

Function skip

static/plugins/chart.js/Chart.js:11395–11424  ·  view source on GitHub ↗
(ticks, spacing, majorStart, majorEnd)

Source from the content-addressed store, hash-verified

11393}
11394
11395function skip(ticks, spacing, majorStart, majorEnd) {
11396 var start = valueOrDefault$a(majorStart, 0);
11397 var end = Math.min(valueOrDefault$a(majorEnd, ticks.length), ticks.length);
11398 var count = 0;
11399 var length, i, tick, next;
11400
11401 spacing = Math.ceil(spacing);
11402 if (majorEnd) {
11403 length = majorEnd - majorStart;
11404 spacing = length / Math.floor(length / spacing);
11405 }
11406
11407 next = start;
11408
11409 while (next < 0) {
11410 count++;
11411 next = Math.round(start + count * spacing);
11412 }
11413
11414 for (i = Math.max(start, 0); i < end; i++) {
11415 tick = ticks[i];
11416 if (i === next) {
11417 tick._index = i;
11418 count++;
11419 next = Math.round(start + count * spacing);
11420 } else {
11421 delete tick.label;
11422 }
11423 }
11424}
11425
11426var Scale = core_element.extend({
11427

Callers 1

Chart.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected