You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using nullSpots in fl_chart's LineChart to split the line, the app crashes with a NaN exception during layout. This seems to be caused by a calculation error when handling null values in spots. Below is the full stack trace and relevant code.
Steps to Reproduce:
Use LineChart from fl_chart.
Set up the LineChartBarData with nullSpots to split the line into multiple segments.
Run the app and trigger the chart rendering.
Observe the crash and NaN exception.
Expected Behavior:
The nullSpots feature should split the lines without causing a crash. It should gracefully handle null values and render the chart properly.
StackTrace
object.dart:2627
packages/flutter/src/rendering/proxy_box.dart 117:21<fn>
proxy_box.dart:117
packages/flutter/src/rendering/object.dart 2627:7 layout
object.dart:2627
packages/flutter/src/rendering/proxy_box.dart 117:21<fn>
proxy_box.dart:117
packages/flutter/src/rendering/object.dart 2627:7 layout
object.dart:2627
packages/flutter/src/rendering/proxy_box.dart 117:21<fn>
proxy_box.dart:117
packages/flutter/src/rendering/object.dart 2627:7 layout
object.dart:2627
packages/flutter/src/rendering/proxy_box.dart 586:12 performLayout
proxy_box.dart:586
packages/flutter/src/rendering/object.dart 2627:7 layout
object.dart:2627
packages/flutter/src/rendering/proxy_box.dart 297:7 performLayout
proxy_box.dart:297
packages/flutter/src/rendering/object.dart 2627:7 layout
object.dart:2627
packages/flutter/src/rendering/layout_helper.dart 61:10 layoutChild
layout_helper.dart:61
packages/flutter/src/rendering/flex.dart 1079:71 [_computeSizes]
flex.dart:1079
packages/flutter/src/rendering/flex.dart 1121:32 performLayout
flex.dart:1121
packages/flutter/src/rendering/object.dart 2465:7 [_layoutWithoutResize]
object.dart:2465
packages/flutter/src/rendering/object.dart 1062:17 flushLayout
object.dart:1062
packages/flutter/src/rendering/object.dart 1075:14 flushLayout
object.dart:1075
packages/flutter/src/rendering/binding.dart 609:5 drawFrame
binding.dart:609
packages/flutter/src/widgets/binding.dart 1178:13 drawFrame
binding.dart:1178
packages/flutter/src/rendering/binding.dart 475:5 [_handlePersistentFrameCallback]
binding.dart:475
packages/flutter/src/scheduler/binding.dart 1397:7 [_invokeFrameCallback]
binding.dart:1397
packages/flutter/src/scheduler/binding.dart 1318:9 handleDrawFrame
binding.dart:1318
packages/flutter/src/scheduler/binding.dart 1176:5 [_handleDrawFrame]
binding.dart:1176
dart-sdk/lib/async/zone.dart 1414:13 _rootRun
zone.dart:1414
dart-sdk/lib/async/zone.dart 1317:19 run
zone.dart:1317
dart-sdk/lib/async/zone.dart 1225:7 runGuarded
zone.dart:1225
lib/_engine/engine/platform_dispatcher.dart 1410:9 invoke
platform_dispatcher.dart:1410
lib/_engine/engine/platform_dispatcher.dart 310:5 invokeOnDrawFrame
platform_dispatcher.dart:310
lib/_engine/engine/initialization.dart 187:36<fn>
initialization.dart:187
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 212:27 _callDartFunctionFast1
js_allow_interop_patch.dart:212
════════════════════════════════════════════════════════════════════════════════════════════════════
18Another exception was thrown:Unsupported operation:NaN```
**Screenshot**![Image](https://github.com/user-attachments/assets/e53564ac-659e-440d-a50d-d4be21e3aac8)**AdditionalContext:**The issue occurs when attempting to use nullSpots for splitting lines in the chart. It seems the library doesn't properly handle null values in the FlSpot list. Adding validation or better handling of null values might fix the issue.Thanks in Advance!
The text was updated successfully, but these errors were encountered:
When using nullSpots in fl_chart's LineChart to split the line, the app crashes with a NaN exception during layout. This seems to be caused by a calculation error when handling null values in spots. Below is the full stack trace and relevant code.
Steps to Reproduce:
Use LineChart from fl_chart.
Set up the LineChartBarData with nullSpots to split the line into multiple segments.
Run the app and trigger the chart rendering.
Observe the crash and NaN exception.
Expected Behavior:
The nullSpots feature should split the lines without causing a crash. It should gracefully handle null values and render the chart properly.
StackTrace
The text was updated successfully, but these errors were encountered: