mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-21 07:36:52 +01:00
Make legend appearance consistent with chart elements (#5621)
This commit is contained in:
committed by
Simon Brunel
parent
f093c36574
commit
feeda5d034
@@ -92,6 +92,8 @@ function drawBorder(ctx, vm, arc) {
|
||||
}
|
||||
|
||||
module.exports = Element.extend({
|
||||
_type: 'arc',
|
||||
|
||||
inLabelRange: function(mouseX) {
|
||||
var vm = this._view;
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ defaults._set('global', {
|
||||
});
|
||||
|
||||
module.exports = Element.extend({
|
||||
_type: 'line',
|
||||
|
||||
draw: function() {
|
||||
var me = this;
|
||||
var vm = me._view;
|
||||
|
||||
@@ -35,6 +35,8 @@ function yRange(mouseY) {
|
||||
}
|
||||
|
||||
module.exports = Element.extend({
|
||||
_type: 'point',
|
||||
|
||||
inRange: function(mouseX, mouseY) {
|
||||
var vm = this._view;
|
||||
return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
|
||||
|
||||
@@ -131,6 +131,8 @@ function inRange(vm, x, y) {
|
||||
}
|
||||
|
||||
module.exports = Element.extend({
|
||||
_type: 'rectangle',
|
||||
|
||||
draw: function() {
|
||||
var ctx = this._chart.ctx;
|
||||
var vm = this._view;
|
||||
|
||||
Reference in New Issue
Block a user