Skip to content

Commit

Permalink
give correct range back for polarArea
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeLenaleee committed May 5, 2022
1 parent 2c268f0 commit 64f3308
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/controllers/controller.polarArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@ export default class PolarAreaController extends DatasetController {
this.updateElements(arcs, 0, arcs.length, mode);
}

/**
* @protected
*/
getMinMax() {
const meta = this._cachedMeta;
const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};

meta.data.forEach((element, index) => {
const parsed = this.getParsed(index).r;

if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {
if (parsed < range.min) {
range.min = parsed;
}

if (parsed > range.max) {
range.max = parsed;
}
}
});

return range;
}

/**
* @private
*/
Expand Down

0 comments on commit 64f3308

Please sign in to comment.