Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix polar area tooltip item label #9067

Merged
merged 1 commit into from May 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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