chartjs / chartjs/Chart.js

Set label of piechart/donut chart using parsing

Open
#11,772 0 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Feature Proposal

The line chart supports the parsing of data as
```
dataset = [
{
data: [{
label: 'Sale',
value: 15
}, {
label: 'Purchase',
value: 20
}]]
}

...
options = {
parsing: {
xAxisKey: 'label',
yAxisKey: 'value'
}
}
```

But in the case of a pie chart and doughnut chart, there is only one parsing key
```
options = {
parsing: {
key: 'value'
}
}
```

But how can I set the label for in this case?

As a workaround, I still need to do data processing to extra labels and set labels explicitly.

### Possible Implementation

On option to set label to the data of pie chart as well.

e.g.,
```
options = {
parsing: {
key: 'value',
label: 'label'
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.