SparkChartTrackball constructor

const SparkChartTrackball({
  1. double width = 2,
  2. Color? color,
  3. List<double>? dashArray,
  4. SparkChartActivationMode activationMode = SparkChartActivationMode.tap,
  5. TextStyle labelStyle = const TextStyle(fontFamily: 'Roboto', fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 12),
  6. SparkChartTooltipCallback<String>? tooltipFormatter,
  7. Color? backgroundColor,
  8. bool shouldAlwaysShow = false,
  9. double hideDelay = 0,
  10. Color? borderColor,
  11. double borderWidth = 0,
  12. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(5)),
})

Creates an instance of spark chart trackball to enable the trackball on the closest data point from the touch position.

@override
Widget build(BuildContext context) {
 return Scaffold(
   body: Center(
       child: SfSparkAreaChart(
     trackball: SparkChartTrackball(borderWidth: 2,
     borderColor: Colors.black, activationMode: SparkChartActivationMode.doubleTap),
     data: <double>[18, 24, 30, 14, 28],
   )
  ),
 );
}

Implementation

const SparkChartTrackball(
    {this.width = 2,
    this.color,
    this.dashArray,
    this.activationMode = SparkChartActivationMode.tap,
    this.labelStyle = const TextStyle(
        fontFamily: 'Roboto',
        fontStyle: FontStyle.normal,
        fontWeight: FontWeight.normal,
        fontSize: 12),
    this.tooltipFormatter,
    this.backgroundColor,
    this.shouldAlwaysShow = false,
    this.hideDelay = 0,
    this.borderColor,
    this.borderWidth = 0,
    this.borderRadius = const BorderRadius.all(Radius.circular(5))});