Class ChartCrosshairSettings
Provides options to customize the crosshair for charts.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Charts
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class ChartCrosshairSettings : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker
Remarks
Configure general crosshair behavior and appearance. For axis-specific tooltip customization, use ChartAxisCrosshairTooltip within the respective axis.
Constructors
ChartCrosshairSettings()
Declaration
public ChartCrosshairSettings()
Properties
DashArray
Gets or sets the dash pattern for the crosshair line.
Declaration
public string DashArray { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string defining the dash array (e.g., |
Remarks
Customize the visual style of the crosshair line using SVG dash patterns.
Examples
<ChartCrosshairSettings Enable="true" DashArray="5,3" />
Enable
Gets or sets a value indicating whether the crosshair is enabled.
Declaration
public bool Enable { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true to enable the crosshair; otherwise, false. The default value is false. |
Remarks
When enabled, crosshair lines appear for precise inspection of data values.
HighlightCategory
Gets or sets a value indicating whether the entire category range is highlighted on hover.
Declaration
public bool HighlightCategory { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
Applicable only to category axes.
Examples
<ChartCrosshairSettings Enable="true" HighlightCategory="true" />
Line
Gets or sets the crosshair line customization.
Declaration
public ChartCrosshairLine Line { get; set; }
Property Value
| Type | Description |
|---|---|
| ChartCrosshairLine | An instance of ChartCrosshairLine that configures color and width. |
Remarks
Use this to override the default line styling.
Examples
<ChartCrosshairSettings Enable="true">
<ChartCrosshairLine Width="2" Color="blue"></ChartCrosshairLine>
</ChartCrosshairSettings>
LineType
Gets or sets the type of crosshair line to display.
Declaration
public LineType LineType { get; set; }
Property Value
| Type | Description |
|---|---|
| LineType | A LineType value:
|
Remarks
Determines which crosshair lines are rendered.
Examples
<ChartCrosshairSettings Enable="true" LineType="LineType.Vertical" />
SnapToData
Gets or sets a value indicating whether the horizontal crosshair snaps to the nearest data point.
Declaration
public bool SnapToData { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
Improves precision when hovering near data points on horizontal charts.