chartjs / chartjs/Chart.js

Toggle doughnut vs. label resizing

Open
#11,429 4 comments 1 reaction 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

## Suggestion
There seems to be an opportunity to improve the behaviour of doughnut/pie charts, specifically related to the resizing of the doughnut/pie when the number of labels increases. This is most evident when two doughnut/pie charts are drawn side-by-side on equally sized canvases, with an unequal number of labels.

The default behaviour is to shrink the doughnut/pie in order to accommodate more labels. An alternative behaviour could be to shrink the labels in order to preserve the doughnut/pie size. I believe the second behaviour more closely aligns with user expectation, and saves time resizing elements outside of the library.

## Context
#11425 shows that users are still running into unintuitive behaviours when two doughnuts with equal size canvases have a different number of labels. Users probably expect that the labels should shrink instead of the doughnut itself.
#3458 seemed to suggest that maintainers prefer users to do the resizing outside of the library: https://github.com/chartjs/Chart.js/issues/3458#issuecomment-798746316
#4982 seems to also have been resolved without changing the sizing behaviour.

### Possible Implementation

_No response_

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.