chartjs / chartjs/Chart.js

Doughnut chart legends issue in chart.js

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

Description

### Expected behavior

Doughnut chart should display data like in the mentioned image.

![image](https://github.com/chartjs/Chart.js/assets/140801712/3d11abeb-43f7-4846-85ff-6d8458507310)

### Current behavior

![image (1)](https://github.com/chartjs/Chart.js/assets/140801712/5a7e637d-8ac9-4d9b-b15e-8f15c1feafbd)

Doughnut chart is displaying data like above in image if it has more than 3-4 legends.

If anyone has solution for it, it would be really helpful.

Thanks.

### Reproducible sample

this.chart0 = new Chart(ctx1, { type: this.shadow ? 'doughnutWithShadow' : 'doughnut', data: data, options: options, plugins: [this.chartService.centerTextPlugin] });

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

2.9.3

### Browser name and version

Chrome

### Link to your project

_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.