Skip to content
ChartslibraryUI Get Pro

Actual vs forecast

Actuals solid, forecast dashed from the last actual, plan line and uncertainty band.

Get Pro to install · $79 once<ActualVsForecastChart />

When to use

  • Revenue or demand forecasts against plan
  • Latest estimate reviews
  • Any chart where forecast and actual share a line

When not to use

Good practice

  • Keep actual and forecast in separate keys; the chart joins them honestly.
  • Say when the forecast was made in the subtitle.

Installation

Actual vs forecast is a Pro chart.

Installation is part of Pro

The full source is included in the Pro download. Get Pro to install it with the CLI and use it in unlimited projects.

Unlock with Pro
Already have Pro?npx chartslibraryui add actual-vs-forecast-chart --from ./chartslibraryui-pro

Usage

Usage examples are part of Pro

Every example on this page comes with its code in the Pro download. The props and data shape below are public.

Unlock with Pro

Data

Rows with an x key, an actual key (null in the future), a forecast key, and optional plan and band keys.

[{ month: "Aug", actual: 2.31e6, forecast: null, plan: 2.23e6 }, { month: "Sep", actual: null, forecast: 2.40e6, plan: 2.29e6 }]

Missing values are null. Invalid values make the chart say what’s wrong instead of drawing a misleading picture. How charts handle bad data

Props

Every chart also accepts the shared frame props: title, subtitle, source, height, mode, toolbar. Common API

export interface ActualVsForecastChartProps extends FrameProps {
  data: Row[];
  x: string;
  /** Key of actual values (null in future periods). */
  actual: string;
  /** Key of forecast values (null in past periods, or overlapping the last actual). */
  forecast?: string;
  /** Optional plan / budget / target line. */
  plan?: string;
  /** Uncertainty bands around the forecast, widest first. */
  bands?: ForecastBand[];
  format?: FormatInput;
  /** Include zero on the y axis. Default true. */
  zero?: boolean;
  actualLabel?: string;
  forecastLabel?: string;
  planLabel?: string;
  /** Print the end-of-horizon forecast and its gap to plan. Default true. */
  endCallout?: boolean;
}
Pro

Fan chart

A forecast with nested uncertainty intervals that widen with the horizon.

Pro

Pacing chart

Cumulative month-to-date actual against plan with a run-rate projection.

Line chart

Trends over time for one to four series, with gaps for missing data and marked forecasts.