New to Telerik UI for BlazorStart a free 30-day trial

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

Constructors

C#
public ChartCategoryAxisMajorGridLines()

Properties

C#
[Parameter]
public RenderFragment ChildContent { get; set; }

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.

C#
[Parameter]
public string Color { get; set; }

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.

C#
[Parameter]
public DashType? DashType { get; set; }

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.

C#
[Parameter]
public double? Skip { get; set; }

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.

C#
[Parameter]
public double? Step { get; set; }

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.

C#
[Parameter]
public bool? Visible { get; set; }

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.

C#
[Parameter]
public double? Width { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override void OnAfterRender(bool firstRender)
Parameters:firstRenderbool

Overrides: ComponentBase.OnAfterRender(bool)

C#
protected override void OnInitialized()

Overrides: DataVizChildComponent.OnInitialized()

C#
protected override void OnParametersSet()

Overrides: ComponentBase.OnParametersSet()

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>