Im using flutter web.
When I create a scatterplot that has an onmarkerrender call on it like this:
SfCartesianChart(
onMarkerRender: (args) {
}
It throws this error when I zoom in: IF i take the empty function away it zooms fine. This is most definitely a bug.
The following IndexError was thrown during paint():
RangeError (index): Index out of range: no indices are valid: 0
The relevant error-causing widget was:
SfCartesianChart SfCartesianChart:file:///C:/Users/TWK463/StudioProjects/iot_dashboard%20-%20PreHTTP-Firebase/lib/stationDataCharts.dart:175:18
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 590:7 _get]
packages/syncfusion_flutter_charts/src/chart/utils/helper.dart 2817:30 triggerMarkerRenderEvent
packages/syncfusion_flutter_charts/src/chart/common/common.dart 1052:47 animateScatterSeries
packages/syncfusion_flutter_charts/src/chart/chart_segment/scatter_segment.dart 105:7 onPaint
packages/syncfusion_flutter_charts/src/chart/chart_series/series_renderer_properties.dart 289:12 drawSegment
packages/syncfusion_flutter_charts/src/chart/series_painter/scatter_painter.dart 291:34 paint
packages/flutter/src/rendering/custom_paint.dart 573:12 [_paintWithPainter]
packages/flutter/src/rendering/custom_paint.dart 615:7 paint
packages/flutter/src/rendering/object.dart 3059:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 253:12 paintChild
packages/flutter/src/rendering/proxy_box.dart 146:14 paint
packages/flutter/src/rendering/object.dart 3059:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 169:10 _repaintCompositedChild
packages/flutter/src/rendering/object.dart 112:5 repaintCompositedChild
packages/flutter/src/rendering/object.dart 1147:31 flushPaint
packages/flutter/src/rendering/binding.dart 494:19 drawFrame
packages/flutter/src/widgets/binding.dart 905:13 drawFrame
packages/flutter/src/rendering/binding.dart 358:5 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1284:15 [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1214:9 handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1072:5 [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1236:13 invoke
lib/_engine/engine/platform_dispatcher.dart 244:5 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 190:45 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37 _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39 dcall
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#2806c relayoutBoundary=up2
... parentData: <none> (can use size)
... constraints: BoxConstraints(0.0<=w<=1500.0, 0.0<=h<=248.0)
... size: Size(0.0, 0.0)
... painter: ScatterChartPainter#cb85f(ValueNotifier<int>#92050(0))
RenderObject: RenderCustomPaint#2806c relayoutBoundary=up2
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=1500.0, 0.0<=h<=248.0)
size: Size(0.0, 0.0)
painter: ScatterChartPainter#cb85f(ValueNotifier<int>#92050(0))
Hi Jesse,
We are able to replicate the
reported issue regarding “Range error
exception thrown when zooming the series with onMarkerRender callback”
at
our end and have logged bug report for it in our feedback portal. We will fix
and include the changes in our weekly patch release which is expected to be
rolled out on July 17, 2023. We will update you here once the release is rolled
out and we appreciate your patience until then. You can also track the status
of the bug with the feedback below.
Regards,
Hari Hara Sudhan. K.
Hi Jesse,
Sorry for the inconvenience. We have fixed this issue but due to automation pending at our end, we are unable to move this fix to today’s weekly patch. We will move this issue fix in our SP release, which is expected to be rolled out at the end of July 2023. We will update you here once the release is rolled out and we appreciate your patience until then.
Regards,
Hari Hara Sudhan. K
Hi Jesse,
The reported issue regarding Range error exception thrown when zooming the series with onMarkerRender callback has been fixed and rolled out in our Weekly patch release. Therefore, we kindly request that you upgrade the syncfusion_flutter_charts package to the latest version below to avoid this issue.
Version: https://pub.dev/packages/syncfusion_flutter_charts/versions/22.2.5
Regards,
Natrayan