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

Multiple RangeErrors from yaxis when rendering SFCartesianChart #2212

Open
redwildrider opened this issue Dec 17, 2024 · 0 comments
Open

Multiple RangeErrors from yaxis when rendering SFCartesianChart #2212

redwildrider opened this issue Dec 17, 2024 · 0 comments

Comments

@redwildrider
Copy link

redwildrider commented Dec 17, 2024

Bug description

This bug clogs up my sentry and I cannot avoid it or filter it out

Steps to reproduce

  1. Render linechart

Code sample

Code sample
ChartAxis yAxis(TrainingState state, WeightUnit weightUnit) {
    return NumericAxis(
      axisLabelFormatter: (AxisLabelRenderDetails details) => _yAxisLabelFormatter(details, weightUnit),
      maximumLabels: 3,
      borderColor: Colors.transparent,
      borderWidth: 0,
      tickPosition: TickPosition.inside,
      labelStyle: Theme.of(context).textTheme.bodyLarge!.copyWith(fontSize: 12),
      majorTickLines: const MajorTickLines(color: Colors.transparent),
      majorGridLines: MajorGridLines(color: Theme.of(context).colorScheme.surface, width: 1.5),
      opposedPosition: false,
      axisLine: const AxisLine(color: Colors.transparent),
      edgeLabelPlacement: _getEdgeLabelPlacement(),
      labelAlignment: LabelAlignment.end,
      labelPosition: ChartDataLabelPosition.inside,
    );
  }

Screenshots or Video

Screenshots / Video demonstration

Bildschirmfoto 2024-12-17 um 10 48 02

Stack Traces

Stack Traces
════════ Exception caught by rendering library ═════════════════════════════════
The following RangeError was thrown during performLayout():
RangeError (length): Invalid value: Not in inclusive range 0..1: 2

The relevant error-causing widget was:
    NumericAxis NumericAxis:file:///Users/steffenkarcher/Projects/flutter-app/nutrilize/lib/view/screens/training/evaluation/training_diagram.dart:107:12

When the exception was thrown, this was the stack:
#0      List.[] (dart:core-patch/growable_array.dart)
#1      RenderChartAxis._arrangeLabels (package:syncfusion_flutter_charts/src/charts/axis/axis.dart:2623:29)
axis.dart:2623
#2      RenderChartAxis._calculateLabelPositions (package:syncfusion_flutter_charts/src/charts/axis/axis.dart:2516:9)
axis.dart:2516
#3      RenderChartAxis.generateVisibleLabels (package:syncfusion_flutter_charts/src/charts/axis/axis.dart:2439:5)
axis.dart:2439
#4      RenderNumericAxis.generateVisibleLabels (package:syncfusion_flutter_charts/src/charts/axis/numeric_axis.dart:634:11)
numeric_axis.dart:634
#5      RenderChartAxis.performLayout (package:syncfusion_flutter_charts/src/charts/axis/axis.dart:1952:7)
axis.dart:1952
#6      RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#7      RenderCartesianAxes.performLayout.measureVerticalAxes (package:syncfusion_flutter_charts/src/charts/base.dart:2154:14)
base.dart:2154
#8      RenderCartesianAxes.performLayout (package:syncfusion_flutter_charts/src/charts/base.dart:2170:5)
base.dart:2170
#9      RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#10     RenderCartesianChartArea.performLayout (package:syncfusion_flutter_charts/src/charts/base.dart:944:23)
base.dart:944
#11     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#12     _RenderLegendLayoutHandler.performLayout (package:syncfusion_flutter_charts/src/charts/common/core_legend.dart:990:15)
core_legend.dart:990
#13     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#14     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:234:12)
shifted_box.dart:234
#15     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#16     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:234:12)
shifted_box.dart:234
#17     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#18     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:21)
proxy_box.dart:111
#19     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#20     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:21)
proxy_box.dart:111
#21     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608
#22     ChildLayoutHelper.layoutChild (package:flutter/src/rendering/layout_helper.dart:61:11)
layout_helper.dart:61
#23     RenderFlex._computeSizes (package:flutter/src/rendering/flex.dart:985:73)
flex.dart:985
#24     RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:1051:32)
flex.dart:1051
#25     RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
object.dart:2608

On which target platforms have you observed this bug?

Android, iOS

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1.1 24B91 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.96.0)
[✓] Connected device (6 available)
[✓] Network resources

• No issues found!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant