@jsfkit/types
    Preparing search index...

    Type Alias ChartTrendline

    A trendline fitted to a series.

    type ChartTrendline = {
        backward?: number;
        displayEquation?: boolean;
        displayRSquared?: boolean;
        forward?: number;
        intercept?: number;
        label?: Pick<ChartDataLabels, "numberFormat" | "shape" | "textStyle"> & {
            layout?: ChartManualLayout;
            text?: ChartText;
        };
        line?: Line;
        name?: string;
        order?: integer;
        period?: integer;
        type: | "linear"
        | "exponential"
        | "logarithmic"
        | "polynomial"
        | "power"
        | "movingAverage";
    }
    Index

    Properties

    backward?: number

    Number of units to extend the trendline backward.

    0
    
    displayEquation?: boolean
    false
    
    displayRSquared?: boolean
    false
    
    forward?: number

    Number of units to extend the trendline forward.

    0
    
    intercept?: number

    Fixed value where the trendline crosses the value axis. When absent, it's fitted.

    label?: Pick<ChartDataLabels, "numberFormat" | "shape" | "textStyle"> & {
        layout?: ChartManualLayout;
        text?: ChartText;
    }

    Style, position, and text of the R² and equation label.

    Type Declaration

    • Optionallayout?: ChartManualLayout

      Manual position of the label. When absent, the position is automatic.

    • Optionaltext?: ChartText

      Custom label text. Replaces the generated R² and equation text.

    line?: Line

    Style of the trendline. By default, it's a 1.5pt dotted (sysDot) line with round caps, in the series' automatic color.

    name?: string

    Name shown in the legend. When absent, the name is generated.

    order?: integer

    Order of a polynomial trendline (2-6).

    2
    
    period?: integer

    Period of a moving average trendline.

    2
    
    type:
        | "linear"
        | "exponential"
        | "logarithmic"
        | "polynomial"
        | "power"
        | "movingAverage"

    The kind of trendline.

    Value Fits
    linear A straight line.
    exponential An exponential curve.
    logarithmic A logarithmic curve.
    polynomial A polynomial of degree order.
    power A power curve.
    movingAverage The average of the last period points, at each point.