Forecasting, Built Right Into Your Charts

If you've ever needed to show where a trend is heading — not just where it's been — you know the usual workflow: export your data, open a notebook or a separate forecasting tool, run a model, then somehow get the projected values back into your dashboard as a second, disconnected chart. CanvasXpress now closes that gap natively. You can turn on a statistically grounded forecast, complete with a prediction interval, as a configuration option on the same chart that's already plotting your series.

What it does

Give CanvasXpress an ordered series — a time series, a numeric x-axis, anything with a meaningful sequence — and it can now extend that series into the future, drawing a projected line and a shaded confidence band right alongside your historical data. No separate modeling step, no glue code, no second chart to keep in sync.

Under the hood, this is powered by the same class of exponential-smoothing methods that R's forecast package popularized: simple exponential smoothing for series with a stable level, Holt's method for series with a trend, and Holt-Winters (ETS-style) smoothing for series with both trend and seasonality. CanvasXpress picks reasonable defaults, but you're in full control of the method, how far out to project, and how confident the interval should be.

Turning it on

Forecasting is exposed as a small set of configuration options that sit next to the regression and LOESS controls you may already be using. The simplest case just flips it on:

var cx = new CanvasXpress(
  "myChart",
  {
    y: {
      vars: ["Revenue"],
      smps: ["Q1", "Q2", "Q3", "Q4", "Q5", "Q6", "Q7", "Q8"],
      data: [[102, 108, 115, 121, 128, 135, 141, 150]]
    }
  },
  {
    graphType: "Scatter2D",
    showForecast: true
  }
);

That one line — showForecast: true — is enough to get a reasonable projection with a default prediction interval drawn as a band. From there, you can tune the behavior precisely:

cx.updateConfig(
  {
    showForecast: true,
    forecastMethod: "holt",
    forecastHorizon: 6,
    forecastInterval: 0.95
  },
  true
);

Because these are ordinary configuration options, they work everywhere CanvasXpress configuration works: pass them at construction time, flip them on later with updateConfig, or read the current settings back with getConfig to build your own UI controls around them.

Why this matters

The honest gap between CanvasXpress and full BI platforms like Tableau or Spotfire has historically been predictive analytics — the ability to look at a series and say "here's where this is likely going, and here's the uncertainty around that." Regression fits and LOESS smoothing have long covered the "what's the underlying shape of this data" question. Forecasting answers the forward-looking one, and it's built with the same philosophy: a statistical transform computed by the engine itself, not bolted on by an external tool.

That matters in practice for a few reasons:

It travels with the chart. Because the forecast is computed and drawn by the core engine, it's available wherever CanvasXpress renders — in a standalone page, inside a dashboard panel, from R or Python bindings, or in a notebook. You don't get a "dashboards-only" forecasting feature; you get a chart-level capability that every consumer of CanvasXpress inherits automatically.

It's reproducible. Every chart in CanvasXpress can be saved as JSON from the toolbar's Save-as-JSON action, and that saved file — including the forecast configuration — can simply be dropped back onto a chart container to reload it exactly as it was. If you need to hand a forecasted chart to a colleague or archive the exact state of an analysis, that's a drag-and-drop away. The toolbar's Reproduce action goes a step further, replaying the chart's construction so you can see precisely how the projection was built.

It behaves consistently with what you already know. The prediction band is drawn using the same visual language as the regression and LOESS confidence bands you may already be familiar with, so there's no new visual grammar to learn. Turning off showForecast returns the chart to exactly what it looked like before — nothing about your existing charts changes unless you opt in.

A practical example

Imagine a quarterly revenue series with a clear upward trend. Setting forecastMethod: "holt" and forecastHorizon: 4 projects the next four quarters as a continuation of that trend line, with a shaded band showing the range of outcomes you can be 95% confident in (via forecastInterval: 0.95). If that same series has an obvious seasonal pattern — say, a spike every fourth quarter — switching to forecastMethod: "ets" and setting forecastSeasonLength: 4 lets the model account for that cycle rather than smoothing it away.

Forecasting in CanvasXpress isn't meant to replace a dedicated econometrics toolkit for deep time-series research — it's a fast, native way to answer the question your audience actually asks when they look at a trend: "where is this going, and how sure are we?" Now your chart can answer that on its own.