Skip to content

Error when data length is 1 #20

Description

@hsynaksu

Hi there! Great library

Only issue I have is when length of the data map is only 1, my layout shifts weirdly and I get this error:

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 38: ''

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was
AnimatedLineChart-[#5c159]
lib\…\anomaly_tag_screens\wristbands_screen.dart:190
When the exception was thrown, this was the stack
#2 _offsetIsValid (dart:ui/painting.dart:38:10)
#3 Canvas.drawCircle (dart:ui/painting.dart:3643:12)
#4 ChartPainter._drawLines.. (package:fl_animated_linechart/chart/animated_line_chart.dart:351:40)
#5 List.forEach (dart:core-patch/growable_array.dart:285:8)
#6 ChartPainter._drawLines. (package:fl_animated_linechart/chart/animated_line_chart.dart:351:18)
...
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#996d4
RenderObject: RenderCustomPaint#996d4
parentData: (can use size)
constraints: BoxConstraints(w=330.0, h=229.5)
size: Size(330.0, 229.5)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions