flutter-interactive-chart icon indicating copy to clipboard operation
flutter-interactive-chart copied to clipboard

Offset argument contained a NaN value, happens when maxPrice and minPrice are equal

Open siva2204 opened this issue 4 years ago • 1 comments

'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

ig this happens when maxPrice and minPrice are the same in a set of data. this happens in fitPrice function

  double fitPrice(double y) =>
      priceHeight * (maxPrice - y) / (maxPrice - minPrice);

and thanks for the amazing package!

siva2204 avatar Feb 01 '22 14:02 siva2204

'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

ig this happens when maxPrice and minPrice are the same in a set of data. this happens in fitPrice function

  double fitPrice(double y) =>
      priceHeight * (maxPrice - y) / (maxPrice - minPrice);

and thanks for the amazing package!

I have 2 similar issues to siva2204's.

════════ Exception caught by widgets library ═══════════════════════════════════ Cannot interpolate between finite and non-finite values 'dart:ui/lerp.dart': Failed assertion: line 20 pos 10: ''

The relevant error-causing widget was InteractiveChart lib\…\components\interact_chart.dart:98 ════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════ The following assertion was thrown during paint(): Offset argument contained a NaN value. 'dart:ui/painting.dart': Failed assertion: line 52 pos 10: ''

The relevant error-causing widget was InteractiveChart lib\…\components\interact_chart.dart:98 When the exception was thrown, this was the stack #2 _offsetIsValid (dart:ui/painting.dart:52:10) #3 Canvas.drawLine (dart:ui/painting.dart:4167:12) #4 ChartPainter._drawPriceGridAndLabels. package:interactive_chart/src/chart_painter.dart:87 #5 ListIterable.forEach (dart:_internal/iterable.dart:39:13) #6 ChartPainter._drawPriceGridAndLabels package:interactive_chart/src/chart_painter.dart:86 ... The following RenderObject was being processed when the exception was fired: RenderCustomPaint#7f86c relayoutBoundary=up7 RenderObject: RenderCustomPaint#7f86c relayoutBoundary=up7 parentData: (can use size) constraints: BoxConstraints(0.0<=w<=797.7, 0.0<=h<=307.4) size: Size(797.7, 307.4)

finitelooping avatar Feb 05 '22 05:02 finitelooping