# RadzenAxisCrosshair Class

Crosshair configuration of [IChartAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.IChartAxis.md). Add inside a [RadzenCategoryAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenCategoryAxis.md) or [RadzenValueAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenValueAxis.md) to draw a crosshair line for that axis while hovering the chart xAxis.crosshair / yAxis.crosshair. The category axis owns the vertical line; the value axis owns the horizontal line.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenChartComponentBase](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenChartComponentBase.md)
- RadzenAxisCrosshair

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender

## Syntax

```csharp
public class RadzenAxisCrosshair : RadzenChartComponentBase, IComponent, IHandleEvent, IHandleAfterRender
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenAxisCrosshair()` | Crosshair configuration of [IChartAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.IChartAxis.md). Add inside a [RadzenCategoryAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenCategoryAxis.md) or [RadzenValueAxis](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenValueAxis.md) to draw a crosshair line for that axis while hovering the chart xAxis.crosshair / yAxis.crosshair. The category axis owns the vertical line; the value axis owns the horizontal line. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| ChartAxis | [`IChartAxis`](https://blazor.radzen.com/docs/api/Radzen.Blazor.IChartAxis.md) | The axis which this configuration applies to. |
| Label | `bool` | Specifies whether to display a small label at the axis showing the formatted axis value where the crosshair crosses it. The label uses the parent axis's Formatter / FormatString. Set to false by default. |
| LineType | [`LineType`](https://blazor.radzen.com/docs/api/Radzen.Blazor.LineType.md) | Specifies the crosshair line style. Defaults to Dashed. |
| Snap | `bool` | Specifies whether the crosshair snaps to the nearest data point on this axis. Set to true by default. When false the line follows the cursor position exactly. Only meaningful for the category axis line; ignored on the value axis. |
| Stroke | `string` | Specifies the crosshair line color. Any valid CSS color. When null the default var(--rz-chart-crosshair-color) is used. |
| StrokeWidth | `double` | Specifies the crosshair line width in pixels. Set to 1 by default. |
| Visible | `bool` | Specifies whether to display the crosshair line for this axis. Set to false by default. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `ShouldRefreshChart(ParameterView parameters)` | `bool` |  |

## Inherited Members

- From [RadzenChartComponentBase](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenChartComponentBase.md): Chart, DidParameterChange, Initialize, SetParametersAsync, ValidateParameters
- From ComponentBase: Assets, AssignedRenderMode, BuildRenderTree, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnAfterRenderAsync, OnInitialized, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

