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