alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChartAxisMajorGridLines

    Represents the major grid lines for a chart axis, allowing the customization of their color, width, and dash patterns.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ChartSubComponent
    ChartAxisMajorGridLines
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartAxisMajorGridLines : ChartSubComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

    Constructors

    ChartAxisMajorGridLines()

    Declaration
    public ChartAxisMajorGridLines()

    Properties

    Color

    Gets or sets the color of the major grid line.

    Declaration
    [Parameter]
    public string Color { get; set; }
    Property Value
    Type Description
    string

    A string representing the color of the major grid line. The default major grid line color is determined by the chart's theme. By default, the theme is set to Material with a major grid line color of #dbdbdb.

    Remarks

    Use valid hex or rgba CSS color strings for the color value.

    Examples
    // The following code demonstrates setting a custom color for the axis major gridlines.
    <SfChart>
        <ChartPrimaryXAxis>
            <ChartAxisMajorGridLines Color="red"  />
        </ChartPrimaryXAxis>
        <ChartPrimaryYAxis>
            <ChartAxisMajorGridLines Color="blue"  />
        </ChartPrimaryYAxis>
    </SfChart>

    DashArray

    Gets or sets the dash array of the major grid line.

    Declaration
    [Parameter]
    public string DashArray { get; set; }
    Property Value
    Type Description
    string

    A string representing the dash array of the major grid line. The default value is an empty string.

    Remarks

    The dash array is used to create dashed lines, specified by a series of numbers that define the lengths of the dashes and gaps.

    Examples
    // The following code demonstrates setting a custom dash array for the axis major gridlines.
    <SfChart>
        <ChartPrimaryXAxis>
            <ChartAxisMajorGridLines DashArray="5,1" />
        </ChartPrimaryXAxis>
        <ChartPrimaryYAxis>
            <ChartAxisMajorGridLines DashArray="5,1" />
        </ChartPrimaryYAxis>
    </SfChart>

    Width

    Gets or sets the width of the major grid line in pixels.

    Declaration
    [Parameter]
    public double Width { get; set; }
    Property Value
    Type Description
    double

    The double value representing the width of the major grid line in pixels. The default value is 1.

    Remarks

    The width determines the thickness of the grid line on the chart.

    Examples
    // The following code demonstrates setting a width thickness for the axis major gridlines.
    <SfChart>
        <ChartPrimaryXAxis>
            <ChartAxisMajorGridLines Width="3" />
        </ChartPrimaryXAxis>
        <ChartPrimaryYAxis>
            <ChartAxisMajorGridLines Width="3" />
        </ChartPrimaryYAxis>
    </SfChart>

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved