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

TrackballVisibilityMode.auto does not render trackball marker when shape is DataMarkerType.image #2006

Closed Abhisek-Dash-open closed 2 weeks ago

Abhisek-Dash-open commented 1 month ago

Bug description

TrackballVisibilityMode.auto does not render trackball marker when shape is DataMarkerType.image. It works when shape is DataMarkerType.circle is selected and in the series marker settings isVisible is specified as true.

Steps to reproduce

  1. In the given code sample, replace shape parameter of markerSettings of TrackballBehavior with DataMarkerType.image and provide and imageProvider for the image object.
  2. Render the ChartWidget in both cases and see the difference.

Code sample

Code sample ```dart class ChartWidget extends HookWidget { const ChartWidget({super.key, required this.data,}); final List<_SalesData> data; @override Widget build(BuildContext context) { ValueNotifier _trackballBehavior = useState(TrackballBehavior( tooltipDisplayMode: TrackballDisplayMode.none, lineType: TrackballLineType.none, activationMode: ActivationMode.singleTap, shouldAlwaysShow: true, enable: true, markerSettings: const TrackballMarkerSettings( // Setting the marker visibility mode as auto markerVisibility: TrackballVisibilityMode.auto, shape: DataMarkerType.circle, color: Colors.amber, )),); log("Build called"); return SizedBox( height: 400, child: SfCartesianChart( onTrackballPositionChanging: (trackballArgs) { if (trackballArgs.chartPointInfo.seriesIndex == 1) { log("Index: ${trackballArgs.chartPointInfo.dataPointIndex}"); } }, primaryXAxis: const CategoryAxis(), primaryYAxis: const NumericAxis(), // Enabled trackball behavior for the chart trackballBehavior: _trackballBehavior.value, series: >[ LineSeries<_SalesData, String>( dataSource: data, name: "Line Series 2", xValueMapper: (_SalesData sales, _) => sales.year.toString(), yValueMapper: (_SalesData sales, _) => sales.sales, width: 2.5, color: Colors.transparent, markerSettings: const MarkerSettings( isVisible: false // Setting false for the second series to not to render marker for this series. ), dataLabelSettings: const DataLabelSettings(isVisible: false), ), LineSeries<_SalesData, String>( width: 2.5, color: Colors.pink, dataSource: data.getRange(0, 3).toList(), name: "abc", xValueMapper: (_SalesData sales, _) => sales.year.toString(), yValueMapper: (_SalesData sales, _) => sales.sales, markerSettings: // Enabled and setting the marker width and height to 0 in order to render marker only // when the trackball is activated. const MarkerSettings(isVisible: true, width: 0, height: 0), dataLabelSettings: const DataLabelSettings(isVisible: false), ), ]), ); } } class _SalesData { _SalesData(this.sales, this.year); final int year; final int sales; } ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Stack Traces

Stack Traces ```dart No stack trace ```

On which target platforms have you observed this bug?

Android, iOS

Flutter Doctor output

Doctor output ```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.2, on macOS 13.6.7 22G720 darwin-x64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.92.0) [✓] Connected device (3 available) ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • No issues found!```
ThilipChandru commented 1 month ago

Hi @Abhisek-Dash-open,

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

Root cause: We have only considered markerVisibility as visible for fetching the trackball image marker and missed considering markerVisibility when set to auto.

Regards, S Thilip Chandru.

ThilipChandru commented 1 month ago

Hi @Abhisek-Dash-open,

The reported issue has been fixed and rolled out in our weekly patch release. To avoid this issue, we kindly request that you upgrade the syncfusion_flutter_charts package to the latest version below.

Version: https://pub.dev/packages/syncfusion_flutter_charts/versions/26.2.9

Root cause: We have only considered markerVisibility as visible for fetching the trackball image marker and missed considering markerVisibility when set to auto.

Regards, Thilip Chandru.

Abhisek-Dash-open commented 4 weeks ago

I retried the behaviour after updating the package but the issue is persisting and further it is not working for shape: DataMarkerType.circle now too

ThilipChandru commented 3 weeks ago

Hi @Abhisek-Dash-open,

We have checked the reported issue that the shape value DataMarkerType.circle is not working in the latest version. But the issue is not replicate at our end, and it is working fine. We suspect that you have set the markerVisibility to auto, here the TrackballVisibilityMode.auto works based on the series marker visibility. It only renders a marker for the series in which series marker visibility is enabled. So, if you want to enable a marker for all the series set the markerVisibility to visible.

Regards, S Thilip Chandru.