ChartTrendlineProps
Configuration options for rendering a trendline on a chart series.
Trendlines help visualize overall trends or direction in the underlying data, and can be
projected forward or backward to indicate potential movement.
Note: Trendlines are only computed when the parent series has visible: true.
Props
The following table outlines the props for the ChartTrendlineProps:
| Name | Type | Default | Description |
|---|---|---|---|
| accessibility | { ariaLabel: null, focusable: true, role: 'img', tabIndex: 0 } | Provides accessibility options for trendline elements to ensure compatibility with assistive technologies. | |
| animation | { enable: true, duration: 1000, delay: 0 } | Configures animation settings for the trendline, including duration and delay. | |
| backwardForecast | number | 0 | Defines the number of data periods to extend the trendline backward from the first data point. |
| dashArray | string | '' | Dash pattern for the trendline stroke, as comma-separated segment lengths. |
| enableTooltip | boolean | true | Enables or disables tooltips for the trendline. When enabled, hovering over the trendline displays a tooltip with relevant information. |
| forwardForecast | number | 0 | Defines the number of periods by which the trendline should extend forward from the last data point. |
| intercept | number | null | Specifies the y-intercept value for the trendline. This forces the trendline to pass through a specific point on the y-axis. |
| legendShape | 'SeriesType' | Defines the shape used to represent the trendline in the chart legend.
| |
| name | string | '' | Display name of the trendline shown in the chart legend. |
| opacity | number | 1 | Opacity of the trendline stroke (0–1). |
| period | number | 2 | Defines the number of periods used to compute a moving average. |
| polynomialOrder | number | 2 | Specifies the polynomial order for the polynomial trendline.
Only applicable when |
| stroke | string | '' (inherits series color) | Sets the stroke color of the trendline. Accepts any valid CSS color string. |
| type | 'Linear' | Specifies the type of trendline to be rendered. Available options:
| |
| visible | boolean | true | Controls the visibility of the trendline.
When set to |
| width | number | 2 | Specifies the width of the trendline in pixels. |