Hi Bar,
You can achieve your requirement with the help of showByIndex and hide public methods in trackball and onPointDoubleTap callback in the series. Here you need to enable the shoulAlwaysShow property and set the activation mode to none in trackball behavior. Then call the showByIndex public method inside the onPointDoubleTap callback if the previous point index is not the same as the current point index from the callback like the wise call the hide method if both the point index is the same. We have shared the code snippet below for your reference.
Code snippet:
late TrackballBehavior _trackballBehavior;
int? pointIndex;
@override void initState() { _tooltipBehavior = TooltipBehavior(enable: true); _trackballBehavior = TrackballBehavior( enable: true, shouldAlwaysShow: true, activationMode: ActivationMode.none, ); super.initState(); }
LineSeries( onPointDoubleTap: (args) { if (pointIndex == null || pointIndex != args.pointIndex) { _trackballBehavior.showByIndex(args.pointIndex!); pointIndex = args.pointIndex; } else if (pointIndex == args.pointIndex) { _trackballBehavior.hide(); pointIndex = null; } }, // Other required properties ) |
UG,
https://help.syncfusion.com/flutter/cartesian-charts/callbacks#onpointdoubletap
https://help.syncfusion.com/flutter/cartesian-charts/methods#methods-in-trackballbehavior
Regards,
Yuvaraj.