Open DrNiels opened 1 month ago
Hi @DrNiels ,
We have reviewed your query, and to resolve the issue of the chart not loading when using a very small range difference between two data points, we recommend setting the interval property for the axis. Using this, the axis labels can be created at a specified interval, ensuring the chart renders properly. You may also consider using the decimalPlaces property to control the number of decimal digits displayed in the numeric axis labels.
Code snippet:
primaryYAxis: const NumericAxis(
minimum: 77499.99999999999,
maximum: 77500.00000000001,
interval: 0.00000000002,
decimalPlaces: 11,
),
For more details, please refer to this user guide links:
Interval: https://help.syncfusion.com/flutter/cartesian-charts/axis-types#customizing-interval
Decimal places: https://help.syncfusion.com/flutter/cartesian-charts/axis-types#decimal-places
Regards, Kompelli Sravan Kumar.
That doesn't fix the issue in my case. Here's my updated example:
Hi DrNeils,
We have validated the reported issue, and it's occurring due to a very small difference between the data points. The difference between the data points 77499.99999999999 and 77500.00000000001 is 0.00000000002. This small difference results from the precision limitations inherent in floating-point arithmetic. To avoid this issue, we suggest using an interval property value of 0.01 for the axis.
Currently, we don’t support handling large decimals, but we have already logged a feature request for it in our feedback portal. We will prioritize the features of every release based on demand and priority, so this feature will be available in one of our upcoming releases. You can also track the status of the feature using the feedback link below.
Feedback Link: https://www.syncfusion.com/feedback/51656/support-to-render-the-chart-with-having-large-decimal-data
Regards, Kompelli Sravan Kumar.
I would consider this a bug and not a feature as it causes crashes. For now, I guess I'll need to handle this special case manually, so my app doesn't crash.
I see the tag "Waiting for customer response" is still set. Cann I support you with any more information? Or did you simply forget to remove it?
Bug description
When trying to create an axis with a very small range, e.g., from 77499.99999999999 to 77500.00000000001, the chart is not loaded. After some wait duration, an error is thrown. In my case, the duration is approximately 30 seconds and the stack trace also looks like some kind of timeout to me.
I use syncfusion_flutter_charts in version 27.1.50
Steps to reproduce
Load the example and wait a bit.
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; void main() async { runApp( MaterialApp( home: Chart(), ), ); } class Chart extends StatefulWidget { @override StateScreenshots or Video
Screenshots / Video demonstration
Nothing to see, it remains a blank screenStack Traces
Stack Traces
```dart Aborted() ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ The following NativeError object was thrown during performLayout(): RuntimeError: Aborted(). Build with -sASSERTIONS for more info. The relevant error-causing widget was: NumericAxis NumericAxis:org-dartlang-app:/chart_reproduce.dart:21:21 When the exception was thrown, this was the stack: canvaskit/chromium/canvaskit.js 93:151 Ea canvaskit/chromium/canvaskit.js 169:377 k canvaskit/chromium/canvaskit.js 116:52 _MakeFromFontCollection canvaskit/chromium/canvaskit.js 75:396 MakeFromFontCollection lib/_engine/engine/canvaskit/text.dart 1045:29 new lib/_engine/engine/canvaskit/renderer.dart 392:7 createParagraphBuilder lib/ui/text.dart 739:21 new packages/flutter/src/painting/text_painter.dart 1142:44 [_createParagraph] packages/flutter/src/painting/text_painter.dart 1198:64 layout packages/syncfusion_flutter_core/src/utils/helper.dart 154:14 measureText packages/syncfusion_flutter_charts/src/charts/axis/numeric_axis.dart 617:11 generateVisibleLabels packages/syncfusion_flutter_charts/src/charts/axis/axis.dart 1952:7 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/syncfusion_flutter_charts/src/charts/base.dart 2154:13 measureVerticalAxes packages/syncfusion_flutter_charts/src/charts/base.dart 2170:5 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/syncfusion_flutter_charts/src/charts/base.dart 944:23 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/syncfusion_flutter_charts/src/charts/common/core_legend.dart 990:5 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/flutter/src/rendering/shifted_box.dart 234:5 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/flutter/src/rendering/shifted_box.dart 234:5 performLayout packages/flutter/src/rendering/object.dart 2608:7 layout packages/flutter/src/rendering/proxy_box.dart 111:21On which target platforms have you observed this bug?
Web
Flutter Doctor output
Doctor output
```console [√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.5011], locale de-DE) • Flutter version 3.24.3 on channel stable at C:\Users\Niels\Documents\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4) • Android SDK at C:\Users\Niels\AppData\Local\Android\Sdk • Platform android-34, build-tools 34.0.0-rc4 • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Users\Niels\AppData\Local\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.6) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.8.34525.116 • Windows 10 SDK version 10.0.19041.0 [!] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart X Unable to determine bundled Java version. • Try updating or re-installing Android Studio. [√] Android Studio (version 2024.1) • Android Studio at C:\Program Files\Android\Android Studio1 • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314) [√] VS Code, 64-bit edition (version 1.93.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.98.0 [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.5011] • Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.101 • Edge (web) • edge • web-javascript • Microsoft Edge 128.0.2739.42 [√] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. ```