Skip to content

Commit

Permalink
Fix bar line shadow crash when we have only one (or zero) spot, #1466
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Nov 12, 2023
1 parent 07c3d85 commit ba68c76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## nextVersion
* **FEATURE** (by @Dartek12): Added gradient to [FlLine](https://github.com/imaNNeo/fl_chart/blob/master/repo_files/documentations/base_chart.md#FlLine), #1197
* **BUGFIX** (by @imaNNeo): Fix bar line shadow crash when we have only one (or zero) spot, #1466

## 0.64.0
* **BUGFIX** (by @Anas35) Fix Tooltip not displaying when value from BackgroundBarChartRodData is less than zero. #1345.
Expand Down
3 changes: 3 additions & 0 deletions lib/src/chart/line_chart/line_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@ class LineChartPainter extends AxisChartPainter<LineChartData> {
if (!barData.show || barData.shadow.color.opacity == 0.0) {
return;
}
if (barPath.computeMetrics().isEmpty) {
return;
}

_barPaint
..strokeCap = barData.isStrokeCapRound ? StrokeCap.round : StrokeCap.butt
Expand Down

0 comments on commit ba68c76

Please sign in to comment.