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

Doughnut and Pie Charts - Config Options incomplete/incorrect #293

Closed
4 tasks done
DazzlingBob opened this issue Nov 26, 2024 · 1 comment · Fixed by #299
Closed
4 tasks done

Doughnut and Pie Charts - Config Options incomplete/incorrect #293

DazzlingBob opened this issue Nov 26, 2024 · 1 comment · Fixed by #299
Assignees
Labels
bug Something isn't working

Comments

@DazzlingBob
Copy link

Checklist

  • I am able to reproduce the bug with the latest version
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.

Affected version

2.5.0

Steps to reproduce the bug

For the latest spec see: https://www.chartjs.org/docs/latest/charts/doughnut.html#config-options

Expected behavior

example expected api:

  PieOptions pieOptions = new PieOptions()
    .setResponsive(true)
    .setMaintainAspectRatio(true)
    .setCutout("50%")
    .setAnimation(new PieAnimation()
      .setAnimateRotate(true)
      .setAnimateScale(false))
    );

Generates:

"options": {
   "responsive": true,
   "maintainAspectRatio": true,
   "cutout": "50%",
   "animation": {
     "animateRotate": true,
     "animateScale": false
 }

Actual behavior

example current api:

  PieOptions pieOptions = new PieOptions()
    .setResponsive(true)
    .setMaintainAspectRatio(true)
    .setCutoutPercentage(50)
    .setAnimations(new Animations<>(AnimationType.X, new PieAnimation()
      .setAnimateRotate(true)
      .setAnimateScale(false))
    );

Generates:

  "options": {
    "responsive": true,
    "maintainAspectRatio": true,
    "cutoutPercentage": 50,
    "animations":{"animationTypes":{"x":{"animateRotate":true,"animateScale":false}},"x":{"animateRotate":true,"animateScale":false}}  
}

Additional information

No response

@DazzlingBob DazzlingBob added the bug Something isn't working label Nov 26, 2024
@AB-xdev AB-xdev self-assigned this Dec 6, 2024
AB-xdev added a commit that referenced this issue Dec 6, 2024
AB-xdev added a commit that referenced this issue Dec 6, 2024
@AB-xdev
Copy link
Member

AB-xdev commented Dec 6, 2024

Should now be up to date with the Chart JS source.
Will be available in the next release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants