Class ChartTrendline
Represents a single trendline configuration used to predict or visualize trends over a series.
Inheritance
System.Object
ChartTrendline
Implements
System.IAsyncDisposable
Assembly: Syncfusion.Blazor.Toolkit.dll
public class ChartTrendline : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker, IChartElement
<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
Declaration
Properties
Declaration
public string AccessibilityDescription { get; set; }
Property Value
| Type |
Description |
| System.String |
A string used by assistive technologies. Default is empty.
|
// 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>
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.
|
// 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>
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.
|
// 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>
Gets or sets the animation settings for the trendline.
Declaration
public ChartTrendlineAnimation Animation { get; set; }
Property Value
// 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>
Declaration
public double BackwardForecast { get; set; }
Property Value
Declaration
public string DashArray { get; set; }
Property Value
Declaration
public bool EnableTooltip { get; set; }
Property Value
Declaration
public string Fill { get; set; }
Property Value
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.
|
// 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>
Declaration
public double ForwardForecast { get; set; }
Property Value
Declaration
public double Intercept { get; set; }
Property Value
Declaration
public LegendShape LegendShape { get; set; }
Property Value
Gets or sets the marker settings for the trendline.
Declaration
public ChartTrendlineMarker Marker { get; set; }
Property Value
// 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>
Declaration
public string Name { get; set; }
Property Value
Declaration
public double Period { get; set; }
Property Value
Declaration
public double PolynomialOrder { get; set; }
Property Value
Declaration
public TrendlineTypes Type { get; set; }
Property Value
Declaration
public bool Visible { get; set; }
Property Value
Declaration
public double Width { get; set; }
Property Value
Implements
System.IAsyncDisposable