Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
siva2204 opened this issue Feb 1, 2022 · 1 comment

Comments

@siva2204
Copy link

siva2204 commented Feb 1, 2022

'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!

@finitelooping
Copy link

finitelooping commented Feb 5, 2022

'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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants