How to hide the marker displayed in the trackball tooltip (SfCartesianChart) ?
The Flutter Cartesian Chart widget provides support to render marker near the value in the trackball tooltip to convey, which value belongs to which series. The canShowMarker property of InteractiveTooltip can be used to toggle the visibility of the marker in the trackball tooltip. The default value of this property is set as true.
The following steps explain how to hide the marker in the trackball tooltip in the cartesian chart:
Step 1: Initialize the SfCartesianChart with all the required properties and enable the TrackballBehavior for the chart.
late TrackballBehavior _trackballBehavior; @override void initState(){ _trackballBehavior = TrackballBehavior(enable: true); super.initState(); } @override Widget build(BuildContext context) { return Container( child: SfCartesianChart( trackballBehavior: _trackballBehavior, ) ); }
Step 2: To hide the marker in the trackball tooltip, disable the canShowMarker property of InteractiveTooltip in the trackball.
_trackballBehavior = TrackballBehavior( enable: true, tooltipSettings: InteractiveTooltip( // Hide marker in trackball tooltip canShowMarker: false ) );
For further reference on the trackball tooltip marker, please refer to this documentation.