alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartTrendline

    Represents a single trendline configuration used to predict or visualize trends over a series.

    Inheritance
    System.Object
    SfBaseComponent
    ChartSubComponent
    ChartTrendline
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    Namespace: Syncfusion.Blazor.Toolkit.Charts
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class ChartTrendline : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker, IChartElement
    Remarks

    A ChartTrendline defines an analytical model (linear, exponential, polynomial, power, or moving average) drawn on top of a ChartSeries to indicate the direction of data values.

    Trendlines support visual customization, accessibility metadata, markers, gradients, and animation.

    Examples
    <SfChart>
        <ChartSeries DataSource="@Data" XName="X" YName="Y">
            <ChartTrendlines>
                <ChartTrendline Name="Linear" Type="TrendlineTypes.Linear" Width="2" DashArray="5,1">
                    <ChartTrendlineMarker Visible="true" />
                    <ChartTrendlineAnimation Enable="true" Duration="800" />
                </ChartTrendline>
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    Constructors

    ChartTrendline()

    Declaration
    public ChartTrendline()

    Properties

    AccessibilityDescription

    Gets or sets the accessibility description for the ChartTrendline.

    Declaration
    public string AccessibilityDescription { get; set; }
    Property Value
    Type Description
    System.String

    A string used by assistive technologies. Default is empty.

    Examples
    // This example demonstrates how to add a power trendline with an accessibility description to a chart.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline AccessibilityDescription="Power trendline" />
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    AccessibilityDescriptionFormat

    Gets or sets the format string used to generate dynamic accessibility descriptions.

    Declaration
    public string AccessibilityDescriptionFormat { get; set; }
    Property Value
    Type Description
    System.String

    A format string (e.g., "${series.name} : ${point.x}"). Default is empty.

    Remarks

    Applied when accessibility descriptions should be computed at runtime.

    Examples
    // This example demonstrates how to add a power trendline with an accessibility description format to a chart.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline AccessibilityDescriptionFormat="Power trendline" />
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    AccessibilityRole

    Gets or sets the ARIA role for the trendline.

    Declaration
    public string AccessibilityRole { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the ARIA role. Default is empty.

    Examples
    // This example demonstrates how to add a power trendline with an accessibility role to a chart.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline AccessibilityRole="Trendline" />
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    Animation

    Gets or sets the animation settings for the trendline.

    Declaration
    public ChartTrendlineAnimation Animation { get; set; }
    Property Value
    Type Description
    ChartTrendlineAnimation

    A ChartTrendlineAnimation instance specifying animation behavior.

    Examples
    // This example demonstrates how to enable animation for a trendline with a duration of 2000ms.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline>
                    <ChartTrendlineAnimation Enable="true" Duration="2000" />
                </ChartTrendline>
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    BackwardForecast

    Declaration
    public double BackwardForecast { get; set; }
    Property Value
    Type
    System.Double

    DashArray

    Declaration
    public string DashArray { get; set; }
    Property Value
    Type
    System.String

    EnableTooltip

    Declaration
    public bool EnableTooltip { get; set; }
    Property Value
    Type
    System.Boolean

    Fill

    Declaration
    public string Fill { get; set; }
    Property Value
    Type
    System.String

    Focusable

    Gets or sets whether the trendline is focusable via keyboard navigation.

    Declaration
    public bool Focusable { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to enable focus; otherwise false. Default is true.

    Examples
    // This example demonstrates how to make a trendline focusable in a chart.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline Focusable="true" />
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    ForwardForecast

    Declaration
    public double ForwardForecast { get; set; }
    Property Value
    Type
    System.Double

    Intercept

    Declaration
    public double Intercept { get; set; }
    Property Value
    Type
    System.Double

    LegendShape

    Declaration
    public LegendShape LegendShape { get; set; }
    Property Value
    Type
    LegendShape

    Marker

    Gets or sets the marker settings for the trendline.

    Declaration
    public ChartTrendlineMarker Marker { get; set; }
    Property Value
    Type Description
    ChartTrendlineMarker

    A ChartTrendlineMarker with marker properties.

    Examples
    // This example demonstrates how to display trendline markers on a chart.
    <SfChart>
        <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            <ChartTrendlines>
                <ChartTrendline>
                    <ChartTrendlineMarker Visible="true" />
                </ChartTrendline>
            </ChartTrendlines>
        </ChartSeries>
    </SfChart>

    Name

    Declaration
    public string Name { get; set; }
    Property Value
    Type
    System.String

    Period

    Declaration
    public double Period { get; set; }
    Property Value
    Type
    System.Double

    PolynomialOrder

    Declaration
    public double PolynomialOrder { get; set; }
    Property Value
    Type
    System.Double

    Type

    Declaration
    public TrendlineTypes Type { get; set; }
    Property Value
    Type
    TrendlineTypes

    Visible

    Declaration
    public bool Visible { get; set; }
    Property Value
    Type
    System.Boolean

    Width

    Declaration
    public double Width { get; set; }
    Property Value
    Type
    System.Double

    Implements

    System.IAsyncDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved