Skip to content

Trackball Overlapping after Flutter Upgrade #2205

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

Closed
lsrmg opened this issue Dec 13, 2024 · 11 comments
Closed

Trackball Overlapping after Flutter Upgrade #2205

lsrmg opened this issue Dec 13, 2024 · 11 comments
Labels
charts Charts component framework issue Something isn't working which depends framework solved Solved the query using existing solutions waiting for customer response Cannot make further progress until the customer responds.

Comments

@lsrmg
Copy link

lsrmg commented Dec 13, 2024

Bug description

After upgrading Flutter to 3.27.0 (from 3.24.4) the Z-axis for the Trackball are not working correctly anymore.
The same issue is present for Crosshair Tooltips for example.

(updating syncfusion_flutter_charts from 27.1.53 to 28.1.33 didn't resolve the issue)

Steps to reproduce

  1. Upgrading to flutter 3.27.0

Code sample

Code sample
SfCartesianChart(
              plotAreaBorderColor: theme.colorScheme.pmBarBackground,
              plotAreaBorderWidth: 1,
              zoomPanBehavior: ZoomPanBehavior(
                  enableDoubleTapZooming: true,
                  zoomMode: ZoomMode.x,
                  enablePinching: true),
              trackballBehavior: TrackballBehavior(
                  enable: true,
                  activationMode: ActivationMode.singleTap,
                  tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
                  tooltipSettings: InteractiveTooltip(
                      enable: true,
                      format: 'point.y ${chartData.firstOrNull?.unit ?? ''}',
                      borderWidth: 1,
                      borderColor: theme.colorScheme.onSurface,
                      textStyle: TextStyle(color: theme.colorScheme.onSurface),
                      color: theme.colorScheme.surface)),
              primaryXAxis: DateTimeAxis(
                  dateFormat: timeFormat24hSetting.when(
                    data: (is24h) =>
                        is24h ? chartTimeFormat24h : chartTimeFormat12h,
                    loading: () => chartTimeFormat12h,
                    error: (_, __) => chartTimeFormat12h,
                  ),
                  interactiveTooltip: InteractiveTooltip(
                      arrowLength: 0,
                      // Enables the crosshair tooltip
                      enable: true)),
              primaryYAxis: NumericAxis(
                  majorGridLines:
                      MajorGridLines(color: theme.colorScheme.pmBarBackground),
                  interactiveTooltip: InteractiveTooltip(
                      // Disables the crosshair tooltip
                      enable: false)),
              legend: Legend(isVisible: true, position: LegendPosition.bottom),
              // Enable tooltip
              series: <CartesianSeries>[
                FastLineSeries<ChartData, DateTime>(
                    dataSource: chartData,
                    xValueMapper: (ChartData data, _) => data.date,
                    yValueMapper: (ChartData data, _) => data.value,
                    emptyPointSettings:
                        const EmptyPointSettings(mode: EmptyPointMode.average),
                    name: dataLegend,
                    color: theme.colorScheme.pmLineChartColor1,
                    // Duration of series animation
                    animationDuration: 500),
                if (secondDataLegend != '')
                  FastLineSeries<ChartData, DateTime>(
                    dataSource: secondChartData,
                    xValueMapper: (ChartData data, _) => data.date,
                    yValueMapper: (ChartData data, _) => data.value,
                    emptyPointSettings:
                        const EmptyPointSettings(mode: EmptyPointMode.average),
                    name: secondDataLegend,
                    color: theme.colorScheme.pmLineChartColor2,
                    // Duration of series animation
                    animationDuration: 500,
                  )
              ],
            ),

Screenshots or Video

Video demonstration
Screen.Recording.2024-12-13.at.17.03.05.mov

Stack Traces

Stack Traces
-```

</details>


### On which target platforms have you observed this bug?

Android, iOS

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.27.0, on macOS 15.2 24C101 darwin-arm64, locale en-US)
    • Flutter version 3.27.0 on channel stable at /Users/lars/flutter
    • Upstream repository https://github.com/flutter/flutter.gitFramework revision 8495dee1fd (3 days ago), 2024-12-10 14:23:39 -0800Engine revision 83bacfc525
    • Dart version 3.6.0DevTools version 2.40.2

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/lars/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/DeveloperBuild 16C5032a
    • CocoaPods version 1.15.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google
    Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/ContentsFlutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutterDart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dartJava version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.96.0)
    • VS Code at /Applications/Visual Studio Code.app/ContentsFlutter extension version 3.102.0

[✓] Connected device (4 available)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
@lsrmg
Copy link
Author

lsrmg commented Dec 13, 2024

Problem is solved after downgrading to Flutter 3.24.5 (still using updating syncfusion_flutter_charts 28.1.33)

@LavanyaGowtham2021 LavanyaGowtham2021 added charts Charts component open Open labels Dec 16, 2024
@Shunt22
Copy link

Shunt22 commented Dec 17, 2024

It's not just trackball.
After upgrading to Flutter 3.27.0 here is AlertDialog overlapping with LineSeries on Android 13.
image

@ghost
Copy link

ghost commented Dec 19, 2024

Hi @Shunt22,

We have checked the mentioned scenario and tried to replicate the reported issue regarding the Trackball overlapping in the SfCartesianChart widget with the updated SDK version 3.27.0. However, we were unable to reproduce the issue on our end. We have attached the sample we used to test the scenario. Please review the attached sample, and if you are still encountering the issue, we kindly request that you replicate it in the attached sample and provide us with additional details about the specific scenario in which the issue occurs. This will help us assist you more effectively.

Regards,
Kaviyarasan Arumugam.

bd_667955

bd_667955.zip

@Shunt22
Copy link

Shunt22 commented Dec 19, 2024

Hi!
I've slightly modified your code. Adding up to 4096 points to LineSeries and the bug is still happening. When you pressed Floating action button the dialog screen shows under the LineSeries.

I'm testing on Samsung SM-T220. Android 13.
image

Here is the code:

import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_charts/charts.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'charts_tooltip',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class ChartData {
  final DateTime date;
  final double value;
  final String unit;

  ChartData(this.date, this.value, {this.unit = ''});
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    super.key,
  });

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late List<ChartData> chartData;
  late List<ChartData> secondChartData;
  String dataLegend = "Series 1";

  @override
  void initState() {
    super.initState();
    chartData = [];

    for (int i = 0; i < 4096; ++i) {
      chartData.add(
        ChartData(DateTime.now().add(Duration(days: i)), i.toDouble(),
            unit: "°C"),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    return Scaffold(
      floatingActionButton: FloatingActionButton(onPressed: () async {
        String? res = await showDialog(
          context: context,
          builder: (context) {
            return AlertDialog(
              content: Container(
                width: 100,
                height: 100,
                child: Text("I'm overlapping"),
              ),
            );
          },
        );
      }),
      appBar: AppBar(
        title: const Text('Syncfusion Chart Example'),
      ),
      body: Center(
        child: SfCartesianChart(
          plotAreaBorderColor: theme.colorScheme.surface,
          plotAreaBorderWidth: 1,
          zoomPanBehavior: ZoomPanBehavior(
            enableDoubleTapZooming: true,
            zoomMode: ZoomMode.x,
            enablePinching: true,
          ),
          trackballBehavior: TrackballBehavior(
            enable: true,
            activationMode: ActivationMode.longPress,
            tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
            tooltipSettings: InteractiveTooltip(
              enable: true,
              format: 'point.y ${chartData.firstOrNull?.unit ?? ''}',
              borderWidth: 1,
              borderColor: theme.colorScheme.onSurface,
              textStyle: TextStyle(color: theme.colorScheme.onSurface),
              color: theme.colorScheme.surface,
            ),
          ),
          primaryXAxis: DateTimeAxis(
            dateFormat: DateFormat('MM/dd/yyyy'),
            interactiveTooltip: const InteractiveTooltip(
              arrowLength: 0,
              enable: true,
            ),
          ),
          primaryYAxis: NumericAxis(
            majorGridLines: MajorGridLines(color: theme.colorScheme.surface),
            interactiveTooltip: const InteractiveTooltip(
              enable: false,
            ),
          ),
          legend:
              const Legend(isVisible: true, position: LegendPosition.bottom),
          series: <CartesianSeries>[
            FastLineSeries<ChartData, DateTime>(
              dataSource: chartData,
              xValueMapper: (ChartData data, _) => data.date,
              yValueMapper: (ChartData data, _) => data.value,
              emptyPointSettings:
                  const EmptyPointSettings(mode: EmptyPointMode.average),
              name: dataLegend,
              color: theme.colorScheme.primary,
              animationDuration: 500,
            ),
          ],
        ),
      ),
    );
  }
}

Hi @Shunt22,

We have checked the mentioned scenario and tried to replicate the reported issue regarding the Trackball overlapping in the SfCartesianChart widget with the updated SDK version 3.27.0. However, we were unable to reproduce the issue on our end. We have attached the sample we used to test the scenario. Please review the attached sample, and if you are still encountering the issue, we kindly request that you replicate it in the attached sample and provide us with additional details about the specific scenario in which the issue occurs. This will help us assist you more effectively.

Regards, Kaviyarasan Arumugam.

bd_667955

bd_667955.zip

@lsrmg
Copy link
Author

lsrmg commented Dec 20, 2024

We have checked the mentioned scenario and tried to replicate the reported issue regarding the Trackball overlapping in the SfCartesianChart widget with the updated SDK version 3.27.0. However, we were unable to reproduce the issue on our end. We have attached the sample we used to test the scenario. Please review the attached sample, and if you are still encountering the issue, we kindly request that you replicate it in the attached sample and provide us with additional details about the specific scenario in which the issue occurs. This will help us assist you more effectively.

Thanks for looking into this. And thank you @Shunt22 for also providing additional test-information!

I pasted your code (in the video just used 1 instead of the linear value to show the moving overlay) into an iOS App and the issue is present like in my example above. On Android the problem is also present. I tested it also on real devices and the behavior is the same.

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-20.at.11.30.23.mp4

Simulator Screenshot - iPhone 16 Pro - 2024-12-20 at 11 28 33

@ghost
Copy link

ghost commented Dec 20, 2024

Hi @Shunt22 ,

We have replicated the reported issue regarding the Trackball overlapping in the SfCartesianChart widget with the updated SDK version 3.27.0 . The issue is scheduled to be fixed in our upcoming weekly patch release on December 31, 2024. We will notify you here once the release has been rolled out, and we appreciate your patience in the meantime.

Regards,
Kaviyarasan Arumugam.

@lsrmg
Copy link
Author

lsrmg commented Dec 20, 2024

@Kaviyarasansf4298 Thanks a lot for the quick response and the fast rollout of the fix!

@LavanyaGowtham2021 LavanyaGowtham2021 added follow-up scheduled Follow-up scheduled and removed open Open labels Dec 26, 2024
@Yuvaraj-Gajaraj
Copy link
Contributor

Hi @lsrmg ,

We have validated the reported issue on our end and found that it is a framework-level issue involving an incorrect depth value for the drawPoints method in the canvas with line and polygon PointMode. This issue has been acknowledged and fixed by the Flutter team.

In Charts, we used the drawPoints method with PointMode.polygon to render a FastLineSeries, enabling the rendering of a large number of data points with high performance. You can track the issue using the links below.

Issue report link: flutter/flutter#160343

Issue fix: flutter/engine#56494

However, you can resolve this with the help of disabling the impeller in your project. Please refer to the following link to disable the impeller.

iOS: https://docs.flutter.dev/perf/impeller#ios

Android: https://docs.flutter.dev/perf/impeller#android

macOS: https://docs.flutter.dev/perf/impeller#macos

We will notify you once the reported issue is fixed and moved to the stable channel by the Flutter team.

Thanks,
Yuvaraj.

@LavanyaGowtham2021 LavanyaGowtham2021 added waiting for customer response Cannot make further progress until the customer responds. and removed follow-up scheduled Follow-up scheduled labels Dec 27, 2024
@LavanyaGowtham2021 LavanyaGowtham2021 added follow-up scheduled Follow-up scheduled framework issue Something isn't working which depends framework and removed waiting for customer response Cannot make further progress until the customer responds. labels Jan 13, 2025
@Yuvaraj-Gajaraj
Copy link
Contributor

Hi @lsrmg ,

The reported issue of the z-axis depth in the drawPoints method point mode as polygon has been fixed and included in the Flutter 3.27.2 SDK and we ensured that it works fine.

Please upgrade the Flutter SDK version to the latest 3.27.2 to avoid the issue. If you have any more questions, please feel free to let us know we are always happy to help you.

3.27.1:

3.27.2:

Thanks,
Yuvaraj.

@LavanyaGowtham2021 LavanyaGowtham2021 added waiting for customer response Cannot make further progress until the customer responds. solved Solved the query using existing solutions and removed follow-up scheduled Follow-up scheduled labels Jan 15, 2025
@Shunt22
Copy link

Shunt22 commented Jan 15, 2025

The issue indeed seems to be resolved.
Thank you!

@lsrmg
Copy link
Author

lsrmg commented Jan 16, 2025

The issue is solved for me too.

Thanks a lot!

@lsrmg lsrmg closed this as completed Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component framework issue Something isn't working which depends framework solved Solved the query using existing solutions waiting for customer response Cannot make further progress until the customer responds.
Projects
None yet
Development

No branches or pull requests

4 participants