Class
ChartXAxisMajorGridLines

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

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

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

Inheritance: objectComponentBaseDataVizChildComponentChartXAxisMajorGridLines

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

ChartXAxisMajorGridLines()

Declaration

cs-api-definition
public ChartXAxisMajorGridLines()

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 vertically from X-axis tick marks. Accepts any valid CSS color value including hex codes (#FF0000), RGB values (rgb(255,0,0)), or color names (red). Use this property to ensure grid lines complement your chart's color scheme while maintaining sufficient contrast for readability. Default behavior uses a subtle color that doesn't interfere with data visualization.

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 guidance. 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 data 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 data 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 category axes, specifies how many categories to skip between grid lines (e.g., 2 shows every second category). For date axes, defines the time interval between grid lines (e.g., 7 for weekly intervals). Use this property to control grid density and prevent overcrowding in charts with many data points.

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), vertical grid lines appear at each major tick position to help align data points with X-axis categories. 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 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 grid 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 viewing context when choosing width - thicker lines work well for large displays.

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>