SparkChartTrackball constructor
const
SparkChartTrackball({
- double width = 2,
- Color? color,
- List<
double> ? dashArray, - SparkChartActivationMode activationMode = SparkChartActivationMode.tap,
- TextStyle labelStyle = const TextStyle(fontFamily: 'Roboto', fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 12),
- SparkChartTooltipCallback<
String> ? tooltipFormatter, - Color? backgroundColor,
- bool shouldAlwaysShow = false,
- double hideDelay = 0,
- Color? borderColor,
- double borderWidth = 0,
- 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))});