* @return {object[]} * @private
()
| 1635 | * @private |
| 1636 | */ |
| 1637 | _layers() { |
| 1638 | const opts = this.options; |
| 1639 | const tz = opts.ticks && opts.ticks.z || 0; |
| 1640 | const gz = valueOrDefault(opts.grid && opts.grid.z, -1); |
| 1641 | const bz = valueOrDefault(opts.border && opts.border.z, 0); |
| 1642 | |
| 1643 | if (!this._isVisible() || this.draw !== Scale.prototype.draw) { |
| 1644 | // backward compatibility: draw has been overridden by custom scale |
| 1645 | return [{ |
| 1646 | z: tz, |
| 1647 | draw: (chartArea) => { |
| 1648 | this.draw(chartArea); |
| 1649 | } |
| 1650 | }]; |
| 1651 | } |
| 1652 | |
| 1653 | return [{ |
| 1654 | z: gz, |
| 1655 | draw: (chartArea) => { |
| 1656 | this.drawBackground(); |
| 1657 | this.drawGrid(chartArea); |
| 1658 | this.drawTitle(); |
| 1659 | } |
| 1660 | }, { |
| 1661 | z: bz, |
| 1662 | draw: () => { |
| 1663 | this.drawBorder(); |
| 1664 | } |
| 1665 | }, { |
| 1666 | z: tz, |
| 1667 | draw: (chartArea) => { |
| 1668 | this.drawLabels(chartArea); |
| 1669 | } |
| 1670 | }]; |
| 1671 | } |
| 1672 | |
| 1673 | /** |
| 1674 | * Returns visible dataset metas that are attached to this scale |
no test coverage detected