* @private
(x, y)
| 501 | * @private |
| 502 | */ |
| 503 | _getLegendItemAt(x, y) { |
| 504 | let i, hitBox, lh; |
| 505 | |
| 506 | if (_isBetween(x, this.left, this.right) |
| 507 | && _isBetween(y, this.top, this.bottom)) { |
| 508 | // See if we are touching one of the dataset boxes |
| 509 | lh = this.legendHitBoxes; |
| 510 | for (i = 0; i < lh.length; ++i) { |
| 511 | hitBox = lh[i]; |
| 512 | |
| 513 | if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) |
| 514 | && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) { |
| 515 | // Touching an element |
| 516 | return this.legendItems[i]; |
| 517 | } |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | return null; |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Handle an event |
no test coverage detected