Skip to content

Offset argument contained a NaN value #18

Closed
@papakay

Description

@papakay

Hi, I want to really commend the great work done so far with this library.

I experience the error above when i have data rows as below

_chartData.dataRows = [
      [0.0, 0.0, 0.0, 0.0, 0.0],
      [0.0, 0.0, 0.0, 0.0, 0.0],
      [0.0, 0.0, 0.0, 0.0, 0.0],
      [0.0, 0.0, 0.0, 0.0, 0.0],
    ];

Part of the error message:

flutter: ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown during paint():
flutter: Offset argument contained a NaN value.
flutter: 'dart:ui/painting.dart': Failed assertion: line 38: '<optimized out>'
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      _offsetIsValid (dart:ui/painting.dart:38:10)
flutter: #3      Canvas.drawLine (dart:ui/painting.dart:3146:12)
flutter: #4      LineContainer.paint (package:flutter_charts/src/chart/line_container.dart:20:12)
flutter: #5      GridLinesContainer.paint.<anonymous closure> (package:flutter_charts/src/chart/container.dart:1094:62)
flutter: #6      List.forEach (dart:core/runtime/libgrowable_array.dart:277:8)
flutter: #7      GridLinesContainer.paint (package:flutter_charts/src/chart/container.dart:1094:21)
flutter: #8      DataContainer.paint (package:flutter_charts/src/chart/container.dart:1028:31)
flutter: #9      ChartPainter.drawGrid (package:flutter_charts/src/chart/painter.dart:76:29)
flutter: #10     ChartPainter.paint (package:flutter_charts/src/chart/painter.dart:55:5)
flutter: #11     RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:521:13)
flutter: #12     RenderCustomPaint.paint (package:flutter/src/rendering/custom_paint.dart:559:7)
flutter: #13     RenderObject._paintWithContext

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions