* @private
()
| 530 | * @private |
| 531 | */ |
| 532 | _getRuler() { |
| 533 | const opts = this.options; |
| 534 | const meta = this._cachedMeta; |
| 535 | const iScale = meta.iScale; |
| 536 | const pixels = []; |
| 537 | let i, ilen; |
| 538 | |
| 539 | for (i = 0, ilen = meta.data.length; i < ilen; ++i) { |
| 540 | pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i)); |
| 541 | } |
| 542 | |
| 543 | const barThickness = opts.barThickness; |
| 544 | const min = barThickness || computeMinSampleSize(meta); |
| 545 | |
| 546 | return { |
| 547 | min, |
| 548 | pixels, |
| 549 | start: iScale._startPixel, |
| 550 | end: iScale._endPixel, |
| 551 | stackCount: this._getStackCount(), |
| 552 | scale: iScale, |
| 553 | grouped: opts.grouped, |
| 554 | // bar thickness ratio used for non-grouped bars |
| 555 | ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage |
| 556 | }; |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * Note: pixel values are not clamped to the scale area. |
no test coverage detected