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
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.
We have checked the mentioned issue and tried to replicate the reported it in SfCartesianChart with version 26.2.9 by,
- Tested the sample in android, windows and web platforms.
- Panned the chart at left most edge and switched the tab.
Regards,
S Thilip Chandru.
Attachment: fm_194016_bc56e98b.zip
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'.
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.
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.
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
- 7 Replies
- 2 Participants
-
PT Progress Together
- Aug 15, 2024 09:09 AM UTC
- Aug 27, 2024 02:08 PM UTC