series.trendline.forecast Object

The trendline forecast settings. By default, the trendline does not display a forecast.

The forecast option is supported when series.type is set to "linearTrendline", "exponentialTrendline", "logarithmicTrendline" or "powerTrendline" and the parent series are either Date Series, "scatter" or "scatterLine" series.

Example - set the trendline forecast

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2021-01-01"),
            price: 111
        }, {
            date: new Date("2021-02-01"),
            price: 141
        }, {
            date: new Date("2021-03-01"),
            price: 151
        }, {
            date: new Date("2021-04-01"),
            price: 121
        }, {
            date: new Date("2021-05-01"),
            price: 111
        }, {
            date: new Date("2021-06-01"),
            price: 111
        }, {
            date: new Date("2021-07-01"),
            price: 145
        }, {
            date: new Date("2021-08-01"),
            price: 125
        }, {
            date: new Date("2021-09-01"),
            price: 145
        }, {
            date: new Date("2021-10-01"),
            price: 135
        }, {
            date: new Date("2021-11-01"),
            price: 155
        }, {
            date: new Date("2021-12-01"),
            price: 185
        }]
    },
    dateField: "date",
    series: [{
        name: "Price",
        type: "line",
        field: "price"
    }, {
        name: "Forecast",
        type: "linearTrendline",
        for: "Price",
        trendline: {
            forecast: {
                before: 3,
                after: 20
            }
        }
    }],
    legend: {
        visible: true,
        position: 'bottom'
    }
});
</script>
In this article