Charts plus JS behaviour

Forecast line

The actual line and its dashed forecast (optionally marching), a confidence band, a “today” line with a ping on the last actual value, and high / low markers.

Real scenarios

The component as it is used in a product — not a specimen grid.

Sales, actual and projected

Six months of actuals, then six projected: the forecast continues from the last actual point as a dashed line (animated marches the dashes, still under reduced motion), and the band widens as uncertainty grows. The future is tinted, the today line pings on the latest actual, and the tooltip over the future reads the projection and its low–high range.

Monthly sales

Million tomans · 80% confidence band

  • Actual
  • Forecast
Monthly sales
ActualForecast Low estimateHigh estimate
Apr 318
May 342
Jun 336
Jul 371
Aug 398
Sep 384
Oct 412 396 428
Nov 431 404 458
Dec 455 417 493
Jan 472 421 523
Feb 498 432 564
Mar 521 441 601

Storage runway

No band this time, a linear curve and a renamed pill (today-label) — the dashed line shows the disk filling up week by week.

Used storage

TB · cluster eu-1

  • Actual
  • Forecast
Used storage
ActualForecast
W1 41.2
W2 43
W3 44.1
W4 46.3
W5 48
W6 49.6
W7 51.4
W8 53.1
W9 54.9
W10 56.6

Important props

Important props
Prop Type Default What it does
labels array [] Every point’s label: the actual ones first, then the forecast.
actual / forecast array [] The actual values and the ones after the last actual.
lower / upper array null The confidence band’s bounds, as long as forecast.
animated / today-label bool / string false / «امروز» Marching dashes (still under reduced motion) and the today pill ('' hides it).
markers / ping bool true / true High / low markers and the ping.

Snippet

<x-nx::forecast-line title="فروش ماهانه" :labels="$months"
    :actual="$sales" :forecast="$projection"
    :lower="$low" :upper="$high" animated />