Skip to content
ChartslibraryUI Get Pro

Fan chart

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

When to use

  • Forecasts where uncertainty matters
  • Scenario communication to executives

When not to use

  • You don't have real interval estimates; don't draw invented bands

Good practice

  • Label what the bands mean ("80% of simulated outcomes").
  • Don't set zero when the series sits far from zero.

Installation

Fan chart 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 fan-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 actual, forecast and lower/upper keys for one or two intervals.

[{ month: "Mar", actual: null, forecast: 1260, p10: 1190, p90: 1330, p25: 1225, p75: 1295 }]

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 FanChartProps extends Omit<ActualVsForecastChartProps, "bands" | "plan"> {
  /** Keys of the outer interval (e.g. 10th and 90th percentile). */
  outer: { lower: string; upper: string; label?: string };
  /** Keys of the inner interval (e.g. 25th and 75th percentile). */
  inner?: { lower: string; upper: string; label?: string };
}
Pro

Actual vs forecast

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

Line chart

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