Panning a SFCartesianChart affects the other charts display

Hello Team,

I have a TabBar which has 3 tabs. Each Tab hosts a SFCartesian chart which means i have 3 SFCartesian charts.

When i pan the 3rd Tab chart to the left most point, and switch over to 2nd tab, the display of chart in the 2nd tab is completely skewed. However as I go back to Tab 3 and come back to Tab 2, the Chart is shown properly. Not sure what is happening in this case. Please help.





Attachment: share_6bfb0cc1.zip

7 Replies

PT Progress Together August 16, 2024 01:17 PM UTC

Hello... Any reply for us... One of the best ways to replicate the error is have only 2 entires for

chartDataYear and once the graph is displayed pan to the left most point and then switch tabs.



TC Thilip Chandru Soundraraj Syncfusion Team August 16, 2024 02:49 PM UTC

Hi Progress Together,


We have checked the mentioned issue 
and tried to replicate the reported it in SfCartesianChart with version 26.2.9 by,

  1. Tested the sample in android, windows and web platforms.
  2. Panned the chart at left most edge and switched the tab.
However, we were unable to reproduce it on our end. Please check the attached sample, and if you are still experiencing the issue, we request that you replicate it in the attached sample and provide us with more details regarding the specific scenario in which you are encountering this issue. This will help us to assist you more effectively.


Regards,

S Thilip Chandru.


Attachment: fm_194016_bc56e98b.zip


PT Progress Together August 16, 2024 04:34 PM UTC

I get a build error as below with the project shared,


Launching lib/main.dart on sdk gphone arm64 in debug mode...

Running Gradle task 'assembleDebug'...

../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder<Constraints, RenderObject>'.

 - 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').

 - 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('../../development/flutter/packages/flutter/lib/src/rendering/object.dart').

 - 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('../../development/flutter/packages/flutter/lib/src/rendering/object.dart').

Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.

        renderObject.markNeedsBuild();

                     ^^^^^^^^^^^^^^

../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/base.dart:3317:7: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderLoadingIndicator'.



PT Progress Together August 17, 2024 01:00 PM UTC

Even in the project provided, when you click on yearly tab there is no data at all. when you scroll you get to see data. Pls check. Also when I added 5 entires for yearly data and scroll the day and month both to the left most point, and come back to yearly tab, the graph is skewed.



PT Progress Together August 17, 2024 01:08 PM UTC

Here is the video recording of the same.


Attachment: video.webm_395d67e3.zip


TC Thilip Chandru Soundraraj Syncfusion Team August 22, 2024 05:48 AM UTC

Hi Progress Together,


Query 1:

The reported issue arises because the Flutter SDK was upgraded to version 3.24.0 on August 6, 2024, while our packages are currently compatible with Flutter SDK version 3.22.3. We have begun evaluating the compatibility and feasibility of updating our packages to work with the latest Flutter version, 3.24.0. We plan to make our packages compatible and include them in our Volume 3 main release, which is expected to be rolled out in the second week of September. In the meantime, we kindly request that you use Flutter SDK version 3.22.3 when working with our syncfusion_flutter_charts package.


Query  2:

We have reproduced the issue you reported on our end and the issue is scheduled to be fixed in our upcoming weekly patch release on Aug 27, 2024. We will notify you here once the release has been rolled out, and we appreciate your patience in the meantime.


Regards,

S Thilip Chandru.



TC Thilip Chandru Soundraraj Syncfusion Team August 27, 2024 02:08 PM UTC

Hi Progress Together,


We have forwarded this query to the development team, and they have confirmed that it is not an issue. According to Flutter's behavior, we did not assign a key to all charts, which causes the new APIs to update when moving to another chart tab. As a result, the previous chart's 'zoomFactor' and 'zoomPosition' are maintained in the new chart tab.

However, you can resolve this issue by assigning a key to all charts. Using unique keys helps Flutter identify each chart individually, preventing state mixing or unintended behavior. Please refer to the attached sample below for your reference.


Regards,

S Thilip Chandru.



Attachment: fm_194016_(2)_1eccee99.zip


Loader.
Up arrow icon