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.55k stars 756 forks source link

Large trackball tooltip protrudes from widget #2004

Open furuyan opened 1 month ago

furuyan commented 1 month ago

Bug description

I want to display a large width custom tooltip on my Chart. But, If the tooltip has a large width, it will extend below the widget when it is in the center of the chart.

There is space at the top of the Widget, so it would be nice if the Tooptip was placed on top.

Steps to reproduce

  1. Drag a chart

Code sample

Code sample ```dart void main() { return runApp(_ChartApp()); } class _ChartApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Chart Demo', theme: ThemeData(primarySwatch: Colors.blue), home: _MyHomePage(), ); } } class _MyHomePage extends StatefulWidget { // ignore: prefer_const_constructors_in_immutables _MyHomePage({Key? key}) : super(key: key); @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<_MyHomePage> { late TrackballBehavior _trackballBehavior; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.grey, appBar: AppBar( title: const Text('Syncfusion Flutter chart'), ), body: Center( child: Container( height: 500, width: 340, child: SfCartesianChart( backgroundColor: Colors.white, primaryXAxis: CategoryAxis(), trackballBehavior: TrackballBehavior( enable: true, activationMode: ActivationMode.singleTap, shouldAlwaysShow: true, markerSettings: const TrackballMarkerSettings( markerVisibility: TrackballVisibilityMode.auto, borderColor: Colors.red, ), tooltipSettings: InteractiveTooltip(enable: true, color: Colors.red), builder: (BuildContext context, TrackballDetails trackballDetails) { return Container( width: 200, height: 150, color: Colors.yellow, child: Center( child: Text("big tooltip"), ), ); }, ), series: >[ LineSeries<_SalesData, String>( dataSource: <_SalesData>[ _SalesData('Jan', 105), _SalesData('Feb', 18), _SalesData('Mar', 14), _SalesData('Apr', 12), _SalesData('May', 48), _SalesData('Jun', 44), _SalesData('Jul', 42), _SalesData('Aug', 70) ], xValueMapper: (_SalesData sales, _) => sales.year, yValueMapper: (_SalesData sales, _) => sales.sales, markerSettings: MarkerSettings(isVisible: true, width: 0, height: 0)), ]), ), )); } } class _SalesData { _SalesData(this.year, this.sales); final String year; final double sales; } ```

Screenshots or Video

Screenshots / Video demonstration

Stack Traces

Stack Traces No stack traces

On which target platforms have you observed this bug?

Android, iOS

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.91.1) [✓] Connected device (5 available) [✓] Network resources ```
PreethikaSelvam commented 1 month ago

Hi @furuyan,

Thank you for letting us know about this issue. We can reproduce the reported issue. This issue is scheduled to be fixed in our Volume 3 main release, which is expected to be rolled out in the second week of September. We will update you here once the release is rolled out, and we appreciate your patience until then.

Regards,

Preethika Selvam.

furuyan commented 1 month ago

Thanks for the quick fix! I'm Looking forward to this release.