Skip to content

Commit

Permalink
Fixed groupBarsPosition exception, #313
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Apr 23, 2020
1 parent 6b289f6 commit d839959
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/src/chart/bar_chart/bar_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ class BarChartPainter extends AxisChartPainter<BarChartData> with TouchHandler<B
/// find the nearest spot base on the touched offset
BarTouchedSpot _getNearestTouchedSpot(
Size viewSize, Offset touchedPoint, List<_GroupBarsPosition> groupBarsPosition) {
// if (groupBarsPosition == null) {
// return null;
// }
if (groupBarsPosition == null) {
final List<double> groupsX = _calculateGroupsX(viewSize, data.barGroups, data.alignment);
groupBarsPosition = _calculateGroupAndBarsPosition(viewSize, groupsX, data.barGroups);
}

final Size chartViewSize = getChartUsableDrawSize(viewSize);

/// Find the nearest barRod
Expand Down

0 comments on commit d839959

Please sign in to comment.