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

Bugfix: Index out of bounds for LineChartData spots #643

Closed

Conversation

JtheSaw
Copy link

@JtheSaw JtheSaw commented Apr 20, 2021

When changing to another LineChartData of different length while indicator spot is set higher than length of new data this error occured:

======== Exception caught by rendering library =====================================================
The following IndexError was thrown during paint():
RangeError (index): Index out of range: index should be less than 5: 170

The relevant error-causing widget was: 
  LineChart file:///Users/xxxxxx/lib/view/widget/dashboard/graph_widget.dart:45:25
When the exception was thrown, this was the stack: 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49  throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 581:7             _get]
packages/fl_chart/src/chart/line_chart/line_chart_painter.dart 313:27         [_drawTouchedSpotsIndicator]
packages/fl_chart/src/chart/line_chart/line_chart_painter.dart 112:7          paint
packages/fl_chart/src/chart/line_chart/line_chart_renderer.dart 94:14         paint
...
The following RenderObject was being processed when the exception was fired: RenderLineChart#91764 relayoutBoundary=up20
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=532.5, h=299.0)
...  size: Size(532.5, 299.0)
RenderObject: RenderLineChart#91764 relayoutBoundary=up20
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=532.5, h=299.0)
  size: Size(532.5, 299.0)
====================================================================================================

…ifferent length while indicator is set too high for new data
@imaNNeo
Copy link
Owner

imaNNeo commented Apr 30, 2021

Hi, may I ask you to provide a reproducible code? I didn't understand the problem.

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

Successfully merging this pull request may close these issues.

2 participants