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

fix: RadarChart crashes if all values in RadarDataSet are equal #1076

Conversation

ateich
Copy link
Contributor

@ateich ateich commented Jun 30, 2022

If the max and min values in a RadarDataSet are equal, the drawTicks method in radar_chart_painter.dart will enter an infinite loop.

This is due to a for loop that fails to be incremented if the max and min values are equal, causing the loop to never meet its exit condition.

I have replaced the for loop with one that will always exit.

Resolves #882

If the max and min values in a RadarDataSet are equal, the `drawTicks` method in `radar_chart_painter.dart` will enter an infinite loop.

This is due to a for loop that fails to be incremented if the max and min values are equal, causing the loop to never meet its exit condition.

I have replaced the for loop with one that will always exit.

Resolves imaNNeo#882
@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #1076 (72322fb) into master (0212c73) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1076   +/-   ##
=======================================
  Coverage   86.32%   86.32%           
=======================================
  Files          45       45           
  Lines        2808     2808           
=======================================
  Hits         2424     2424           
  Misses        384      384           
Impacted Files Coverage Δ
lib/src/chart/radar_chart/radar_chart_painter.dart 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@imaNNeo
Copy link
Owner

imaNNeo commented Jul 1, 2022

Hi. Did you test it with your new logic?

@imaNNeo imaNNeo merged commit 76c518f into imaNNeo:master Jul 1, 2022
@imaNNeo
Copy link
Owner

imaNNeo commented Jul 1, 2022

Thanks for contributing!

@ateich ateich deleted the fix/radarChartCrashesIfAllValuesInRadarDataSetAreEqual branch July 1, 2022 21:43
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

Successfully merging this pull request may close these issues.

radar chart crash
2 participants