syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.56k stars 762 forks source link

Chart data not visible after updating from v23.1.43 to v26.1.35 #1926

Closed aamoronatti closed 2 months ago

aamoronatti commented 3 months ago

Bug description

Chart data not visible after updating from v23.1.43 to v26.1.35

Steps to reproduce

I updated the charts package from v23.1.43 to v26.1.35 and data is no longer visible on the chart.

I just changed from ChartSeries to CartesianSeries

Code sample

Code sample ```dart class FreqCoordinationChart extends StatelessWidget { @override Widget build(BuildContext context) { final List color = []; color.add(Colors.yellow[50]!); color.add(Colors.yellow[200]!); color.add(Colors.yellow); final List stops = []; stops.add(0.0); stops.add(0.4); stops.add(1.0); final LinearGradient gradientColors = LinearGradient( colors: color, stops: stops, begin: Alignment.bottomCenter, end: Alignment.topCenter); return GetBuilder( builder: (_) => SfCartesianChart( series: [ AreaSeries( dataSource: _.graphData, xValueMapper: (GraphData data, _) => data.x, yValueMapper: (GraphData data, _) => data.y, gradient: gradientColors), ColumnSeries( enableTooltip: true, animationDuration: 0, dataSource: _.getSelectedTransmitter(), width: 0, borderWidth: 3, borderColor: Colors.blue, dataLabelMapper: (data, _) => data.hasConflicts ? "⚠" : "", dataLabelSettings: DataLabelSettings( textStyle: TextStyle( fontWeight: FontWeight.bold, color: Colors.red[300], ), isVisible: true, labelAlignment: ChartDataLabelAlignment.outer), xValueMapper: (tx, _) => tx.freq, yValueMapper: (tx, _) => tx.height, pointColorMapper: (tx, _) => tx.color), ColumnSeries( animationDuration: 0, dataSource: _.calculate3rdOrder3Tx(_.transmitterList.transmitters), width: 0, borderWidth: 1.25, borderColor: Colors.orange, xValueMapper: (ThirdOrderData3Tx tx, _) => tx.freq, yValueMapper: (ThirdOrderData3Tx tx, _) => tx.height, pointColorMapper: (ThirdOrderData3Tx tx, _) => tx.color), ColumnSeries( animationDuration: 0, dataSource: _.calculate3rdOrder2Tx(_.transmitterList.transmitters), width: 0, borderWidth: 1.25, borderColor: Colors.orange, xValueMapper: (ThirdOrderData2Tx tx, _) => tx.freq, yValueMapper: (ThirdOrderData2Tx tx, _) => tx.height, pointColorMapper: (ThirdOrderData2Tx tx, _) => tx.color), ColumnSeries( animationDuration: 0, dataSource: _.calculateFifthOrder(_.transmitterList.transmitters), width: 0, borderWidth: 1.25, borderColor: Colors.lightBlue[200]!, xValueMapper: (FifthOrderData tx, _) => tx.freq, yValueMapper: (FifthOrderData tx, _) => tx.height, pointColorMapper: (FifthOrderData tx, _) => tx.color, ), ColumnSeries( animationDuration: 0, dataSource: _.calculateSeventhOrder(_.transmitterList.transmitters), width: 0, borderWidth: 1.25, borderColor: Colors.purple, xValueMapper: (SeventhOrderData tx, _) => tx.freq, yValueMapper: (SeventhOrderData tx, _) => tx.height, pointColorMapper: (SeventhOrderData tx, _) => tx.color, ), ], primaryYAxis: NumericAxis( minimum: 0, maximum: 60, axisLine: AxisLine(width: 0), majorTickLines: MajorTickLines(width: 0), ), primaryXAxis: NumericAxis( minimum: _.getMinBoundaries() - 50, maximum: _.getMaxBoundaries() + 50, axisLine: AxisLine(width: 0), interactiveTooltip: InteractiveTooltip(enable: false), majorTickLines: MajorTickLines(width: 0), ), zoomPanBehavior: ZoomPanBehavior( enableSelectionZooming: true, maximumZoomLevel: 0.01, enablePinching: true, zoomMode: ZoomMode.x, enablePanning: true, enableMouseWheelZooming: false, ), ), ); } } ```

Screenshots or Video

Screenshots / Video demonstration v26 - Not working ![v26](https://github.com/syncfusion/flutter-widgets/assets/107871283/2b289d7a-4668-4efe-8f0e-4bbe9beeaf33) v23 - Working ![v23](https://github.com/syncfusion/flutter-widgets/assets/107871283/af32f306-0085-42c2-ae08-fd4cb62ada80)

Stack Traces

Stack Traces ```dart [Add the Stack Traces here] ```

On which target platforms have you observed this bug?

Android, iOS

Flutter Doctor output

Doctor output ```console [Add your output here] ```
Yuvaraj-Gajaraj commented 3 months ago

Hi,

We have checked the reported issue that the chart is not rendered in the SfCartesianChart version 26.1.35 and we have tested with the help of a shared code snippet and ensured it is working fine. We have shared the test sample below. If you are still facing an issue please reproduce in that shared sample and get back to us. It will be more helpful to us to provide a solution sooner.

Sample: github_1926.zip

aamoronatti commented 3 months ago

I have replicated the issue in your code:

github_1926.zip

I've noticed that the error is due to non fixed decimal numbers.

ghost commented 3 months ago

Hi @aamoronatti,

We can replicate the reported issue on our end and the issue is scheduled to be fixed in our weekly patch release, which is expected to be rolled out on July 2, 2024. We will update you here once the release is rolled out and we appreciate your patience until then.

Regards, Lokesh P.

ghost commented 3 months ago

Hi @aamoronatti,

The reported issue is fixed, and the fix published in the below version. 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/26.1.40

Root cause: We have ignored the paint method if the segment's left and right or top and bottom values are the same, without considering the stroke width.

Regards, Lokesh P.

aamoronatti commented 3 months ago

Good to know.

Thank you!