Skip to content

[Bug] PieChart: Option-level AnimationDuration and AnimationUpdateDurtation are overwritten with default values on series level. #20192

Description

@michaelwittmann

Version

5.2.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=pie-simple&code=PYBwLglsB2AEC8sDeAoWsCG0IFsORgBEBXAJ3ymgC4BGABgboBpY1Ns8DoTyuBVEABN8AU1qNmbAM4jSEEVKqwA2m3Sp0m2NAw4xsAOQBBAMYmFU2ADFSwHAaZrNYAJ4h9BkPIdP05QRDEioYArHQApD5a6MJgGEqq0ZpIsABuGAA2xPr0ACwAHCw6ekoGAMoiGKQmABawAKLQAOYQ0CIGsAC-jknqaZnZSgDsAMwhRboehBCkIiZgHd2-yf1Z-iH5zNqTpfV4EBmLPb0p6WtKBbkTJYZ82DCwRoJSR8t9Z4OwIwzXHgBqEEEImAj2ei2WAF0nJ02FDOgBuIA

Steps to Reproduce

Specifying the animaitonDuration or animationDuration on option-level has no effect in PieCharts, wether it works in all other major chart types (Line, Bar ...)

No Effect:

option = {
  animationDuration:10000,  // Has no effect
  animationDurationUpdate:10000,  // Has no effect
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ]
    }
  ]
};

Working alternative:

option = {

  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      animationDuration:10000, // works
      animationDurationUpdate:10000,  // works
    }
  ]
};

Current Behavior

The animationDurationand animationDurationUpdate defined on option-level is not applied, because it is overwritten with series-level default values specified here:

animationDuration: 1000,
// Animation type when update. Valid values: transition, expansion
animationTypeUpdate: 'transition',
animationEasingUpdate: 'cubicInOut',
animationDurationUpdate: 500,

As far as I observed PieChart is the only chart type where such default values are defined 🤔 .

Expected Behavior

Specifying animationDuration and other animation-related parameters should be consistent across different chart types.
Both options should produce the same result:

Option 1:

option = {
  animationDuration:10000,  // Has no effect
  animationDurationUpdate:10000,  // Has no effect
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ]
    }
  ]
};

Option 2:

option = {
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      animationDuration:10000, // works
      animationDurationUpdate:10000,  // works
    }
  ]
};

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions