ClassChartXAxisMajorGridLines
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:
public class ChartXAxisMajorGridLines : DataVizChildComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseDataVizChildComponentChartXAxisMajorGridLines
Implements:
Inherited Members
Constructors
ChartXAxisMajorGridLines()
Declaration
public ChartXAxisMajorGridLines()
Properties
ChildContent
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
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.
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
[Parameter]
public DashType? DashType { get; set; }
Property Value
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.
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.
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.
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.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnAfterRender(bool)
Declaration
protected override void OnAfterRender(bool firstRender)
Parameters
firstRender
Overrides
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides
OnParametersSet()
Declaration
protected override void OnParametersSet()
Overrides
Serialize()
Declaration
public Dictionary<string, object> Serialize()
Returns