Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Inconsistent Doughnut Arc Spacing

Open jjstanton opened this issue 2 years ago • 4 comments

Expected behavior

Consistent spacing between arcs greater than 1. If only one arc, no spacing is required.

Current behavior

Inconsistent spacing between arcs and spacing on singular arcs.

Reproducible sample

https://codepen.io/JJStanton/pen/YzrjRVw

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

v3.7.0

Browser name and version

Chrome - Version 97.0.4692.71

Link to your project

No response

jjstanton avatar Jan 07 '22 20:01 jjstanton

To fix this we probably need to change how the spacing works. Right now it moves the arcs away from the center of the canvas by the spacing amount. Thus is doesn't provide any guarantees about what the space between the ends of the arc is. If we want to provide a consistent spacing in that direction we'll need to shrink the angles to create the space rather than moving the arcs away from the center

etimberg avatar Apr 02 '22 21:04 etimberg

Just reached this issue. I'm also unable to code graph in a following way :(

image

cotwitch avatar Jun 21 '22 15:06 cotwitch

Facing the same issue

ArthurGorbenko avatar Nov 08 '22 19:11 ArthurGorbenko

I’ve ended up using default spacing while letting poor graphic designer screaming in agony.

cotwitch avatar Nov 08 '22 22:11 cotwitch

As a possible workaround you can interlace values with the 'spacer' values and use transparent background color on them. This works better for thinner doughnuts. See my comment here https://github.com/chartjs/Chart.js/issues/10286#issuecomment-1410946775

spaghettiguru avatar Jan 31 '23 19:01 spaghettiguru

Still an issue. Any plans fixing this?

sammyaxe avatar Apr 04 '23 21:04 sammyaxe

Still an issue

Screenshot 2023-08-31 at 10 29 22 am
datasets: {
        doughnut: {
          borderWidth: 0,
          spacing: 2,
        },
      },

jasperdunn avatar Aug 31 '23 00:08 jasperdunn

@etimberg Any chance we can have this item looked at?

jjstanton avatar Aug 31 '23 06:08 jjstanton