diff --git a/CHANGELOG.md b/CHANGELOG.md index 43b359d42..cdf52f7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## newVersion +* **BUGFIX** (by @ateich): Fix infinite loop in RadarChart when all values in RadarDataSet are equal, #882. * **BUGFIX** (by @ateich): Fix uneven titles in RadarChart when using titlePositionPercentageOffset, #1074. ## 0.55.0 diff --git a/lib/src/chart/radar_chart/radar_chart_painter.dart b/lib/src/chart/radar_chart/radar_chart_painter.dart index 9dbc407fc..894bed9fe 100644 --- a/lib/src/chart/radar_chart/radar_chart_painter.dart +++ b/lib/src/chart/radar_chart/radar_chart_painter.dart @@ -99,13 +99,12 @@ class RadarChartPainter extends BaseChartPainter { final dataSetMaxValue = data.maxEntry.value; final dataSetMinValue = data.minEntry.value; final tickSpace = (dataSetMaxValue - dataSetMinValue) / data.tickCount; - final ticks = []; + double tickValue = dataSetMinValue; - for (var tick = dataSetMinValue; - tick <= dataSetMaxValue; - tick = tick + tickSpace) { - ticks.add(tick); + for (var i = 0; i <= data.tickCount; i++) { + ticks.add(tickValue); + tickValue += tickSpace; } final tickDistance = radius / (ticks.length);