Class
ChartCategoryAxisMajorGridLines

Configures the major grid lines that extend from category axis major ticks across the chart plot area. Creates vertical reference lines that help users align data points with category values. Essential for improving chart readability by providing visual guides for data interpretation. Controls line styling, color, thickness, and visibility for professional chart presentation.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

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

Inheritance: objectComponentBaseDataVizChildComponentChartCategoryAxisMajorGridLines

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

ChartCategoryAxisMajorGridLines()

Declaration

cs-api-definition
public ChartCategoryAxisMajorGridLines()

Properties

ChildContent

Declaration

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

Property Value

RenderFragment

Color

Sets the color of major grid lines on the category axis. Accepts any valid CSS color including hex codes (#E0E0E0), RGB values (rgb(224,224,224)), named colors (lightgray), or HSL values. Use subtle colors like light gray to provide visual reference without overwhelming the chart data.

Declaration

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

Property Value

string

DashType

Defines the line style pattern for major grid lines using DashType values. Choose from various patterns: Solid for continuous lines, Dash for dashed lines, Dot for dotted lines, DashDot for alternating dashes and dots, LongDash for longer dash segments, LongDashDot for long dashes with dots, and LongDashDotDot for complex patterns. Different patterns can help distinguish grid lines from data series.

Declaration

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

Property Value

DashType?

Skip

Sets how many major grid lines to skip from the beginning of the category axis. Use this to offset the grid line pattern, for example, Skip=1 starts grid lines from the second category instead of the first. Useful for aligning grid lines with specific data patterns or visual requirements.

Declaration

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

Property Value

double?

Step

Controls the interval between major grid lines on the category axis. Set to 1 to show a grid line at every category, 2 for every other category, etc. This helps reduce visual clutter in charts with many categories while maintaining useful reference lines for data reading.

Declaration

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

Property Value

double?

Visible

Controls whether major grid lines are displayed on the category axis. Set to true (default) to show grid lines for better data reading, or false to hide them for cleaner chart appearance. Major grid lines help users trace data points to their corresponding category values.

Declaration

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

Property Value

bool?

Width

Sets the thickness of major grid lines in pixels. Use thin lines (0.5-1 pixel) for subtle reference grids, or thicker lines (2-3 pixels) for more prominent visual guides. Combine with Color and DashType to create the desired visual hierarchy in your chart.

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>