Class ChartTrackballBehavior
Enables the trackball in the Syncfusion.Maui.Charts.ChartTrackballBehavior.CartesianChart.
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class ChartTrackballBehavior : ChartBehavior, IMarkerDependent
Constructors
ChartTrackballBehavior()
Initializes a new instance of the ChartTrackballBehavior class.
Declaration
public ChartTrackballBehavior()
Fields
DisplayModeProperty
Identifies the DisplayMode bindable property.
Declaration
public static readonly BindableProperty DisplayModeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
LabelStyleProperty
Identifies the LabelStyle bindable property.
Declaration
public static readonly BindableProperty LabelStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
LineStyleProperty
Identifies the LineStyle bindable property.
Declaration
public static readonly BindableProperty LineStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
MarkerSettingsProperty
Identifies the MarkerSettings bindable property.
Declaration
public static readonly BindableProperty MarkerSettingsProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
ShowLineProperty
Identifies the ShowLine bindable property.
Declaration
public static readonly BindableProperty ShowLineProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
ShowMarkersProperty
Identifies the ShowMarkers bindable property.
Declaration
public static readonly BindableProperty ShowMarkersProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty |
Properties
DisplayMode
Gets or sets display mode of trackball labels.
By default, labels for all the series under the current point index value will be shown.
Declaration
public LabelDisplayMode DisplayMode { get; set; }
Property Value
Type | Description |
---|---|
LabelDisplayMode | Defaults to FloatAllPoints |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior DisplayMode="NearestPoint"/>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
LabelStyle
Gets or sets the value to customize the appearance of trackball labels.
Declaration
public ChartLabelStyle LabelStyle { get; set; }
Property Value
Type | Description |
---|---|
ChartLabelStyle |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior>
<chart:ChartTrackballBehavior.LabelStyle>
<chart:ChartLabelStyle TextColor="Red" FontSize="14"/>
</chart:ChartTrackballBehavior.LabelStyle>
</chart:ChartTrackballBehavior>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
LineStyle
Gets or sets the value to customize the appearance of the trackball line.
Declaration
public ChartLineStyle LineStyle { get; set; }
Property Value
Type | Description |
---|---|
ChartLineStyle |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior>
<chart:ChartTrackballBehavior.LineStyle>
<chart:ChartLineStyle Stroke = "Red" StrokeWidth="2"/>
</chart:ChartTrackballBehavior.LineStyle>
</chart:ChartTrackballBehavior>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
MarkerSettings
Gets or sets the option for customize the trackball markers.
Declaration
public ChartMarkerSettings MarkerSettings { get; set; }
Property Value
Type | Description |
---|---|
ChartMarkerSettings |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior>
<chart:ChartTrackballBehavior.MarkerSettings>
<chart:ChartMarkerSettings Height = "10" Width="10" Fill="Red"/>
</chart:ChartTrackballBehavior.MarkerSettings>
</chart:ChartTrackballBehavior>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
ShowLine
Gets or sets the value that indicates whether to show the trackball line.
Declaration
public bool ShowLine { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior ShowLine="False"/>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
ShowMarkers
Gets or sets the value that indicates whether to show markers for the trackball.
Declaration
public bool ShowMarkers { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
<chart:SfCartesianChart>
<!--omitted for brevity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior ShowMarkers="False"/>
</chart:SfCartesianChart.TrackballBehavior>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCartesianChart>
Methods
Hide()
Hides the trackball that is visible in the chart.
Declaration
public void Hide()
LabelsGenerated(List<TrackballPointInfo>)
Invokes when the trackball is moved from one data point to another. This helps to customize the trackball label and marker based on the condition.
Declaration
protected virtual void LabelsGenerated(List<TrackballPointInfo> pointInfos)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<TrackballPointInfo> | pointInfos |
OnTouchDown(ChartBase, Single, Single)
Declaration
protected override void OnTouchDown(ChartBase chart, float pointX, float pointY)
Parameters
Type | Name | Description |
---|---|---|
ChartBase | chart | |
System.Single | pointX | |
System.Single | pointY |
Overrides
OnTouchMove(ChartBase, Single, Single)
Declaration
protected override void OnTouchMove(ChartBase chart, float pointX, float pointY)
Parameters
Type | Name | Description |
---|---|---|
ChartBase | chart | |
System.Single | pointX | |
System.Single | pointY |
Overrides
OnTouchUp(ChartBase, Single, Single)
Declaration
protected override void OnTouchUp(ChartBase chart, float pointX, float pointY)
Parameters
Type | Name | Description |
---|---|---|
ChartBase | chart | |
System.Single | pointX | |
System.Single | pointY |
Overrides
Show(Single, Single)
Activate the trackball at the nearest point to the specified location.
Declaration
public void Show(float pointX, float pointY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pointX | |
System.Single | pointY |