SparkChartTrackball class

Enables and customizes the trackball.

Trackball feature displays the tooltip for the data points that are closer to the point where you touch on the chart area. This feature can be enabled by creating an instance of SparkChartTrackball.

Provides option to customizes the activationMode, width, color, labelStyle, backgroundColor, borderColor, borderWidth.

Annotations

Constructors

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.
const

Properties

activationMode SparkChartActivationMode
Defines the gesture for activating the trackball to the closest data point.
final
backgroundColor Color?
Customizes the background color of the trackball tooltip. The color is set based on the current application theme, if its value is set to null.
final
borderColor Color?
Customizes the border color of the trackball tooltip. To make border visible for plot band, need to set both the border color and border width.
final
borderRadius BorderRadius
Customizes the border radius of trackball tooltip.
final
borderWidth double
Customizes the border width of the plot band. To make border visible for plot band, need to set both the border color and border width.
final
color Color?
Customizes the color of the trackball line. The color is set based on the current application theme, if its value is set to null.
final
dashArray List<double>?
Dashes of the trackball line. Any number of values can be provided on the list. Odd value is considered as rendering size and even value is considered a gap.
final
hashCode int
The hash code for this object.
no setteroverride
hideDelay double
Provides the time delay to disappear the trackball on touch. The provided value will be considered as milliseconds. When `shouldAlwaysShow` is set as false, the value provided to this property will be considered as a delay.
final
labelStyle TextStyle
Customizes the data label text style.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldAlwaysShow bool
Shows or hides the trackball..
final
tooltipFormatter SparkChartTooltipCallback<String>?
Callback that gets triggered when a trackball tooltip text is created.
final
width double
Customizes the width of the trackball line.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override