Skip to content

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

Description

@DazzlingBob

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions