Articles in this section
Category / Section

How to hide the marker displayed in the trackball tooltip (SfCartesianChart) ?

1 min read

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.

 

marker is disabled in the trackball tooltip

 

See the sample browser code sample here.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please  to leave a comment
Access denied
Access denied