RadzenAxisCrosshair Class

Crosshair configuration of IChartAxis. Add inside a RadzenCategoryAxis or RadzenValueAxis 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.

Inheritance

Object

ComponentBase

RadzenChartComponentBase

RadzenAxisCrosshair

Implements

IComponent

IHandleEvent

IHandleAfterRender

Inherited Members

RadzenChartComponentBase.Initialize

RadzenChartComponentBase.SetParametersAsync

RadzenChartComponentBase.ValidateParameters

RadzenChartComponentBase.DidParameterChange

RadzenChartComponentBase.Chart

ComponentBase.BuildRenderTree

ComponentBase.OnInitialized

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.OnAfterRenderAsync

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenAxisCrosshair : RadzenChartComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Constructors

RadzenAxisCrosshairlink

Crosshair configuration of IChartAxis. Add inside a RadzenCategoryAxis or RadzenValueAxis 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.

Declaration
public RadzenAxisCrosshair()

Properties

ChartAxislink

The axis which this configuration applies to.

Declaration
public IChartAxis ChartAxis { set; }
Property Value
Type Description
IChartAxisThe axis which this configuration applies to.

Labellink

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.

Declaration
public bool Label { get; set; }
Property Value
Type Description
boolSpecifies 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.

LineTypelink

Specifies the crosshair line style. Defaults to Dashed.

Declaration
public LineType LineType { get; set; }
Property Value
Type Description
LineTypeSpecifies the crosshair line style. Defaults to Dashed.

Snaplink

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.

Declaration
public bool Snap { get; set; }
Property Value
Type Description
boolSpecifies 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.

Strokelink

Specifies the crosshair line color. Any valid CSS color. When null the default var(--rz-chart-crosshair-color) is used.

Declaration
public string Stroke { get; set; }
Property Value
Type Description
stringSpecifies the crosshair line color. Any valid CSS color. When null the default var(--rz-chart-crosshair-color) is used.

StrokeWidthlink

Specifies the crosshair line width in pixels. Set to 1 by default.

Declaration
public double StrokeWidth { get; set; }
Property Value
Type Description
doubleSpecifies the crosshair line width in pixels. Set to 1 by default.

Visiblelink

Specifies whether to display the crosshair line for this axis. Set to false by default.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
boolSpecifies whether to display the crosshair line for this axis. Set to false by default.

Methods

ShouldRefreshChartlink

Declaration
protected override bool ShouldRefreshChart(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
bool
An error has occurred. This app may no longer respond until reloaded. Reload 🗙