BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Is it possible to display trackball by double tapping and also hide trackball by double tapping
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.
Is it possible to do it on all area of the chart and not only points?
Hi Bar,
Currently, we do not have support to display the trackball on all areas of the chart. You can achieve your requirement with the help of crosshairBehavior. By using crosshairBehavior, you can display the axis values on all areas of the chart and not only on points. We have shared the sample link and related UG Documentation below for your reference.
Sample,
https://flutter.syncfusion.com/#/cartesian-charts/user-interactions/crosshair
UG,
https://help.syncfusion.com/flutter/cartesian-charts/trackball-crosshair#crosshair
Regards,
Lokesh Palani.