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 markers near values in the trackball tooltip to indicate which value belongs to which series. The canShowMarker property of InteractiveTooltip can be used to toggle the visibility of markers in the trackball tooltip. By default, this property is set to 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 trackball tooltip marker, please refer to the official documentation.

 

marker is disabled in the trackball tooltip

 

View the Github 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