Skip to content

PluginForecasting API Reference

The PluginForecasting adds advanced time-series prediction capabilities to the SciChart Engine. It implements several statistical forecasting models natively in TypeScript.

Initialization

typescript
import { createChart, PluginForecasting } from 'scichart-engine';

const chart = createChart({ ... });
await chart.use(PluginForecasting({
  defaultOptions: {
    method: 'holtWinters',
    horizon: 50
  }
}));

API Reference

Once registered, the plugin exposes its API through chart.forecasting.

forecast(data, options)

Generates a forecast for the provided raw data.

Parameters:

  • data: SeriesData | number[] | Float32Array - The historical data.
  • options: ForecastingOptions - Configuration for the forecast.

Returns: ForecastingResult

forecastSeries(seriesId, options)

Generates a forecast for a specific series already present in the chart.

Parameters:

  • seriesId: string - ID of the series to analyze.
  • options: ForecastingOptions - Configuration for the forecast.

Returns: Promise<ForecastingResult>

visualize(result, config?)

Renders the forecast on the chart overlay.

Parameters:

  • result: ForecastingResult - The result from a forecast call.
  • config: ForecastingVisualizationConfig - (Optional) Styling configuration.

Returns: string (The visualization ID).

clear(id?)

Removes active forecast visualizations.

Parameters:

  • id: string - (Optional) ID of a specific visualization to remove. If omitted, all forecasts are cleared.

Interfaces

ForecastingOptions

PropertyTypeDescription
methodstringMethod to use (see below)
horizonnumberNumber of points to project
confidencenumber(Optional) Confidence level (0-1)
paramsForecastingParamsMethod-specific parameters

ForecastingMethod

  • 'sma': Simple Moving Average (projects a flat line).
  • 'linear': Linear Trend Projection (Least Squares Fit).
  • 'holt': Double Exponential Smoothing (Trend-aware).
  • 'holtWinters': Triple Exponential Smoothing (Trend + Seasonality).

ForecastingParams

PropertyTypeDescription
alphanumberSmoothing factor for level
betanumberSmoothing factor for trend
gammanumberSmoothing factor for seasonality
periodnumberSeasonal cycle length
windowSizenumberWindow size for SMA

ForecastingResult

PropertyTypeDescription
xValuesnumber[]Projected X coordinates
yValuesnumber[]Projected Y values
lowerBoundnumber[](Optional) Lower confidence limit
upperBoundnumber[](Optional) Upper confidence limit
metadataobjectFit statistics (MSE, MAE, R²)

Released under the MIT License.