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

PieChart & PieChartPro prop mismatch #786

Open
CalvinNFT opened this issue Aug 14, 2024 · 1 comment
Open

PieChart & PieChartPro prop mismatch #786

CalvinNFT opened this issue Aug 14, 2024 · 1 comment

Comments

@CalvinNFT
Copy link

and component are said to have same props

Animation and curved paths are supported in component. It receives all the above props (same as the component)

yet in fact they do not. See below:

Case Pie Chart default component

Pie chart component

  <PieChart
    donut
    initialAngle={-Math.PI * 2}
    centerLabelComponent={innerLabel}
    innerRadius={80}
    innerCircleColor={Colors.BACKGROUND_PRIMARY}
    radius={wp(25)}
    data={pieData}
  />

Case Pie Chart PRO component

image

// same props, different component
  <PieChartPro
    donut
    initialAngle={-Math.PI * 2}
    centerLabelComponent={innerLabel}
    innerRadius={80}
    innerCircleColor={Colors.BACKGROUND_PRIMARY}
    radius={wp(25)}
    data={pieData}
  />

Note the differences:

  1. Initial angle does not work on Pro component
  2. Pie data is reversed in Pro (Pie values grow counter clock-wise)

I have solved these issues in use with the below solutions:

  1. Not using the Pro component - it has issues with animated input values for in pieData => Smoother to rerender pie
  2. Using Array.reverse()
@sladik-maksym
Copy link

the same problem
Array.reverse() have helped me but this way is terrible
when are you going to fix this issue?

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

No branches or pull requests

2 participants