Browse Source

refactor: refactor data methods (#2481)

pull/2489/head
Yoshiya Hinosawa 6 years ago committed by GitHub
parent
commit
0fde1b0320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/data.js

14
src/data.js

@ -307,12 +307,24 @@ ChartInternal.prototype.getDataLabelLength = function (min, max, key) {
.remove();
return lengths;
};
/**
* Returns true if the given data point is not arc type, otherwise false.
* @param {Object} d The data point
* @return {boolean}
*/
ChartInternal.prototype.isNoneArc = function (d) {
return this.hasTarget(this.data.targets, d.id);
},
};
/**
* Returns true if the given data point is arc type, otherwise false.
* @param {Object} d The data point
* @return {boolean}
*/
ChartInternal.prototype.isArc = function (d) {
return 'data' in d && this.hasTarget(this.data.targets, d.data.id);
};
ChartInternal.prototype.findClosestFromTargets = function (targets, pos) {
var $$ = this,
candidates;

Loading…
Cancel
Save