Skip to content

Period action

Use this action with change({ id: 'Period', context }).

Context

  • id?: Update | Delete (Update is assumed if omitted)
  • period: an ISO 8601 duration string (P[n]Y[n]M[n]DT[n]H[n]M[n]S)
  • range: { from, to } where both values are JavaScript timestamps (Date#getTime())
  • density: number (bar density)
  • period (for Delete): true

Behavior

Period supports:

  • Update: set exactly one of period, range, or density.
  • Delete: clear explicit period settings ({ id: 'Delete', period: true }).

If range is provided, the chart uses explicit from/to timestamps. Setting period, range, or density resets zoom state.