Class
ChartYAxisMajorGridLines

Configures the major grid lines that extend horizontally across the chart from Y-axis major tick marks. Provides comprehensive control over grid line appearance including color, style, spacing, and visibility to enhance chart readability and value interpretation. Use this component to create horizontal visual guides that help users align data points with value positions and improve chart navigation.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class ChartYAxisMajorGridLines : DataVizChildComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseDataVizChildComponentChartYAxisMajorGridLines

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members ComponentBase.OnInitializedAsync()ComponentBase.OnParametersSetAsync()ComponentBase.StateHasChanged()ComponentBase.ShouldRender()ComponentBase.OnAfterRenderAsync(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

ChartYAxisMajorGridLines()

Declaration

cs-api-definition
public ChartYAxisMajorGridLines()

Properties

ChildContent

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChildContent { get; set; }

Property Value

RenderFragment

Color

Specifies the color of the major grid lines that extend horizontally from Y-axis tick marks. Accepts any valid CSS color value including hex codes (#E0E0E0), RGB values (rgb(224,224,224)), or color names (lightgray). Use this property to ensure grid lines complement your chart's color scheme while maintaining sufficient contrast for value reading. Default behavior uses a subtle color that doesn't interfere with data visualization but provides clear horizontal reference lines.

Declaration

cs-api-definition
[Parameter]
public string Color { get; set; }

Property Value

string

DashType

Defines the line pattern for major grid lines using predefined dash styles. Available options include solid lines for standard grids, dashed patterns for subtle guidance, dotted lines for minimal visual impact, and various dash-dot combinations for specialized chart presentations. Choose dash types that balance visual guidance with data clarity - solid lines for emphasis, dashed for subtle value reference. See DashType for all available line pattern options.

Declaration

cs-api-definition
[Parameter]
public DashType? DashType { get; set; }

Property Value

DashType?

Skip

Specifies how many major grid lines to skip at the beginning of the axis. Use this property to align grid lines with specific value points or create custom grid patterns. For example, setting Skip to 1 will start grid lines from the second major tick position. Useful for fine-tuning grid alignment in charts with irregular value distributions or specific formatting requirements.

Declaration

cs-api-definition
[Parameter]
public double? Skip { get; set; }

Property Value

double?

Step

Defines the interval between major grid lines in axis units. For numeric axes, specifies the value interval between grid lines (e.g., 10 shows lines every 10 units). For date axes, defines the time interval between grid lines (e.g., monthly or yearly intervals). Use this property to control grid density and prevent overcrowding in charts with wide value ranges.

Declaration

cs-api-definition
[Parameter]
public double? Step { get; set; }

Property Value

double?

Visible

Controls whether major grid lines are displayed on the chart. When set to true (default), horizontal grid lines appear at each major tick position to help align data points with Y-axis values. Set to false to hide grid lines for cleaner chart presentation or when grid lines might interfere with data visualization. Hidden grid lines can improve focus on data series while maintaining axis tick marks for value reference.

Declaration

cs-api-definition
[Parameter]
public bool? Visible { get; set; }

Property Value

bool?

Width

Sets the thickness of major grid lines in pixels. Use thicker lines (2-3 pixels) to emphasize value structure or thinner lines (0.5-1 pixel) for subtle guidance. This property affects visual prominence and can help establish hierarchy between major and minor grid lines. Consider chart size and data density when choosing width - thicker lines work well for charts requiring precise value reading.

Declaration

cs-api-definition
[Parameter]
public double? Width { get; set; }

Property Value

double?

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnAfterRender(bool)

Declaration

cs-api-definition
protected override void OnAfterRender(bool firstRender)

Parameters

firstRender

bool

Overrides ComponentBase.OnAfterRender(bool)

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides DataVizChildComponent.OnInitialized()

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

Serialize()

Declaration

cs-api-definition
public Dictionary<string, object> Serialize()

Returns

Dictionary<string, object>