Make legend appearance consistent with chart elements (#5621)

This commit is contained in:
Akihiko Kusanagi
2019-05-09 21:33:19 +08:00
committed by Simon Brunel
parent f093c36574
commit feeda5d034
15 changed files with 548 additions and 391 deletions

View File

@@ -92,6 +92,8 @@ function drawBorder(ctx, vm, arc) {
}
module.exports = Element.extend({
_type: 'arc',
inLabelRange: function(mouseX) {
var vm = this._view;

View File

@@ -26,6 +26,8 @@ defaults._set('global', {
});
module.exports = Element.extend({
_type: 'line',
draw: function() {
var me = this;
var vm = me._view;

View File

@@ -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;

View File

@@ -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;