Skip to content

Commit

Permalink
Show proper error message when there is less than 3 RadarEntry in Rad…
Browse files Browse the repository at this point in the history
…arChart, #694
  • Loading branch information
imaN Khoshabi committed Jul 15, 2021
1 parent 7629474 commit b70b4f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## newVersion
* **IMPROVEMENT** Show proper error message when there is less than 3 [RadarEntry](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/radar_chart.md#radarentry) in [RadarChart](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/radar_chart.md), #694.

## 0.36.2
* **IMPROVEMENT** Support `onMouseExit` event in all charts.
* **IMPROVEMENT** Add `rotateAngle` property in [LineTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#linetouchtooltipdata), [BarTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md#bartouchtooltipdata), [ScatterTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#scattertouchtooltipdata), #260, #679.
Expand Down
6 changes: 5 additions & 1 deletion lib/src/chart/radar_chart/radar_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ class RadarDataSet with EquatableMixin {
Color? borderColor,
double? borderWidth,
double? entryRadius,
}) : dataEntries = dataEntries ?? const [],
}) : assert(
dataEntries == null || dataEntries.length == 0 || dataEntries.length >= 3,
'Radar needs at least 3 RadarEntry',
),
dataEntries = dataEntries ?? const [],
fillColor = fillColor ?? Colors.black12,
borderColor = borderColor ?? Colors.blueAccent,
borderWidth = borderWidth ?? 2.0,
Expand Down

0 comments on commit b70b4f9

Please sign in to comment.