Skip to content

Commit

Permalink
Fix polar area tooltip item label (#9067)
Browse files Browse the repository at this point in the history
  • Loading branch information
etimberg committed May 12, 2021
1 parent 9885126 commit 024f406
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/controllers/controller.polarArea.js
@@ -1,5 +1,6 @@
import DatasetController from '../core/core.datasetController';
import {toRadians, PI} from '../helpers/index';
import {formatNumber} from '../helpers/helpers.intl';

export default class PolarAreaController extends DatasetController {

Expand All @@ -10,6 +11,19 @@ export default class PolarAreaController extends DatasetController {
this.outerRadius = undefined;
}

getLabelAndValue(index) {
const me = this;
const meta = me._cachedMeta;
const chart = me.chart;
const labels = chart.data.labels || [];
const value = formatNumber(meta._parsed[index].r, chart.options.locale);

return {
label: labels[index] || '',
value,
};
}

update(mode) {
const arcs = this._cachedMeta.data;

Expand Down

0 comments on commit 024f406

Please sign in to comment.