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

Inconsistent Doughnut Arc Spacing #10059

Open
jjstanton opened this issue Jan 7, 2022 · 10 comments
Open

Inconsistent Doughnut Arc Spacing #10059

jjstanton opened this issue Jan 7, 2022 · 10 comments

Comments

@jjstanton
Copy link

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

@kurkle kurkle added this to the Version 3.8.0 milestone Jan 12, 2022
@etimberg
Copy link
Member

etimberg commented Apr 2, 2022

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 etimberg removed this from the Version 3.8.0 milestone May 22, 2022
@cotwitch
Copy link

cotwitch commented Jun 21, 2022

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

image

@ArthurGorbenko
Copy link

Facing the same issue

@cotwitch
Copy link

cotwitch commented Nov 8, 2022

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

@spaghettiguru
Copy link

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 #10286 (comment)

@sammyaxe
Copy link

sammyaxe commented Apr 4, 2023

Still an issue. Any plans fixing this?

@jasperdunn
Copy link

jasperdunn commented Aug 31, 2023

Still an issue

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

@jjstanton
Copy link
Author

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

@pablovargasosorio
Copy link

Same issue here:
Captura de pantalla 2024-05-09 a las 12 14 42

@JamesTheAlchemist
Copy link

JamesTheAlchemist commented Aug 16, 2024

Until we can get some time to sit down and 'math' this thing out, I have a temporary workaround which includes adding an additional slice into the doughnut with a transparent color. Tweak to your heart's desire.

data={{ datasets: [{ data: ['650', '200', '30', '150'], backgroundColor: [ 'red', 'blue', 'transparent', 'green', ], borderRadius: 50, spacing: 25, }] }}

Also, as a weird side effect of this spacing issue I have noticed that the bottom left and bottom right points of the arch don't line up something. So I changed my rotation from 90 to 92 to visually 'fix' this.

options={{ rotation: -92, circumference: 180 }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants