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

Exception using RadialBarSeries / SfCircularChart #2084

Open
Abhijit-Revamp opened this issue Sep 19, 2024 · 4 comments
Open

Exception using RadialBarSeries / SfCircularChart #2084

Abhijit-Revamp opened this issue Sep 19, 2024 · 4 comments
Labels
charts Charts component follow-up scheduled Follow-up scheduled

Comments

@Abhijit-Revamp
Copy link

Bug description

While adding RadialBarSeries, getting an exception in the following function

  List<LegendItem>? buildLegendItems(int index) {
    final num sumOfY = circularYValues

Steps to reproduce

  1. Add a RadialBarSeries
  2. No customisation - very basic
  3. ensure dataSource has more than 1 item (this is just to ensure something gets rendered)
  4. select Chrome - web as target debugging platform
  5. start debugging

Exception <<

Code sample

Code sample
                  child: SfCircularChart(
                    series: [
                      // Render pie chart
                      RadialBarSeries(
                        dataSource:
                            viewModel.db01GroupedSumCount,
                        xValueMapper: (data, _) => data["typeID"],
                        yValueMapper: (data, _) => data["count"],
                      )
                    ],
                  ),

Screenshots or Video

Screenshots / Video demonstration image

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Web, Web (Android browser), Web (iOS browser)

Flutter Doctor output

Doctor output
Flutter (Channel beta, 3.26.0-0.1.pre, on macOS 14.6.1 23G93 darwin-x64, locale en-IN)
    • Flutter version 3.26.0-0.1.pre on channel beta at /Volumes/Abhi-Data/FlutterDev/SDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee624bc4fd (9 days ago), 2024-09-10 17:41:06 -0500
    • Engine revision 059e4e6d8f
    • Dart version 3.6.0 (build 3.6.0-216.1.beta)
    • DevTools version 2.39.0```

</details>
@VijayakumarMariappan VijayakumarMariappan added charts Charts component open Open labels Sep 20, 2024
@ghost
Copy link

ghost commented Sep 20, 2024

Hi @Abhijit-Revamp,

We have checked the mentioned issue and tried to replicate it in the SfCircularChart with version 27.1.48 by:

  1. Ensured in Windows, Web and Android platforms.
  2. Ensured the Radial series with the default legend and legend item builder.
  3. Ensured the legend toggling with animation.
  4. Ensured by adding data points dynamically to the radial bar series.

However, we were unable to reproduce it on our end. Please check the attached sample, and if you are still experiencing the issue, we request that you replicate it in the attached sample and provide us with more details regarding the specific scenario in which you are encountering this issue. This will help us to assist you more effectively.

Sample: gh_2084.zip

Regards,
Thilip Chandru.

@Abhijit-Revamp
Copy link
Author

@ThilipChandru Thanks for the update. I found the problem.
My data (and in real life app) comes from external source like web services or database.
In one of the case, the entire data for radial series was BLANK (no data received).
That causes the EXCEPTION.
Temporarily I have handled this in my code.
However, can you make the slight change in the code (function buildLegendItems) to either

  1. check empty list before calling "reduce"
  2. replace "reduce" with "fold" : Fold takes initial value as 0 and ensures there is no exception

Thanks

@ghost
Copy link

ghost commented Sep 25, 2024

Hi @Abhijit-Revamp,

We are happy to hear that the solution was found by yourself and thank you for your suggestion. We have reproduced the issue regarding range error exception in LegendItemBuilder on our end and the issue is scheduled to be fixed in our upcoming weekly patch release on October 1, 2024. We will notify you here once the release has been rolled out, and we appreciate your patience in the meantime.

If you have any further queries, please get back to us. We are always happy to assist you.

Regards,
Thilip Chandru.

@LavanyaGowtham2021 LavanyaGowtham2021 added follow-up scheduled Follow-up scheduled and removed open Open labels Sep 26, 2024
@Abhijit-Revamp
Copy link
Author

@ThilipChandru is this change released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component follow-up scheduled Follow-up scheduled
Projects
None yet
Development

No branches or pull requests

3 participants