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

[BUG] Random Angle on Repaint #87

Open
MelvinIdema opened this issue May 27, 2022 · 6 comments
Open

[BUG] Random Angle on Repaint #87

MelvinIdema opened this issue May 27, 2022 · 6 comments

Comments

@MelvinIdema
Copy link

MelvinIdema commented May 27, 2022

Whenever Flutter repaints the PieChart angle will seemingly change to a random angle.

Schermopname.2022-05-27.om.17.32.51.mov

This is how PieChart is used in my app:

           PieChart(
              initialAngleInDegree: 270.0,
              dataMap: {
                "water": value,
              },
              ringStrokeWidth: 6.0,
              chartType: ChartType.ring,
              totalValue: maxValue,
              baseChartColor: Colors.black38,
              colorList: const [
                Colors.greenAccent,
              ],
              chartValuesOptions: const ChartValuesOptions(
                showChartValues: false,
              ),
              legendOptions: const LegendOptions(
                showLegends: false,
              ),
            ),
          ),

What could possibly be the issue? Is it a bug in PieChart self?

@MelvinIdema MelvinIdema changed the title Animation issues on User Input Animation issues on repaint May 27, 2022
@MelvinIdema MelvinIdema changed the title Animation issues on repaint PieChart Random Angle on Repaint May 27, 2022
@MelvinIdema MelvinIdema changed the title PieChart Random Angle on Repaint [BUG] Random Angle on Repaint May 27, 2022
@MelvinIdema
Copy link
Author

Wrapping the PieChart in a RepaintBoundary seems to fix the issue for me. Still, no clue why it happens?

@apgapg
Copy link
Owner

apgapg commented Sep 19, 2022

Can you please provide what data you are passing in data object?
Also what about total value parameter. Currently it makes value rendered as 100% without total value parameter

@avdept
Copy link

avdept commented Sep 19, 2022

I wrapped it into RepaintBoundary and it worked well for me. But I was invoking it like:

PieChart(
        dataMap: {"Title": 5},
        totalValue: 10,
        baseChartColor: const Color(0xAAD6DADA),
        animationDuration: const Duration(milliseconds: 800),
        chartLegendSpacing: 32,
        initialAngleInDegree: 0,
        chartType: ChartType.ring,
        legendOptions: const LegendOptions(showLegends: false),
        chartValuesOptions: const ChartValuesOptions(showChartValues: false),
        ringStrokeWidth: 3,
        chartRadius: 15
        colorList: const [
          Color.fromRGBO(67, 221, 166, 1),
        ],
      )

@apgapg
Copy link
Owner

apgapg commented Sep 19, 2022

Let me just try this sample code

@riccardocescon
Copy link

Same thing happened on
pie_chart: ^5.3.2
Wrapping with RepaintBoundary fixed it

@Tobias-Keller
Copy link

Tobias-Keller commented Feb 20, 2023

Happend to me too,
but happend only when the provided Data is not 100% from the defined totalValue.

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

5 participants