Chart Lifecycle

The chart has three terminal states: stopped, aborted, and canceled, and each has a different meaning:

  • Stopped
    This means the chart stopped normally by reaching an End Step.

  • Aborted
    This means the chart stopped abnormally because of an error.

  • Canceled
    This means that the chart was canceled by a user or a call to system.sfc.cancelChart().

The chart can have scripts configured to run during some transitions between states.

  • onStart
    This script runs before the chart moves to the Running state.

  • onStop
    This script runs in the Stopping state before the chart moves to Stopped state.

  • onAbort
    This script runs in the Aborting state before the chart moves to Aborted state. If this script creates an error, it is logged, and then the chart moves to Aborted state.

  • onCancel
    This script runs in the Canceling state before the chart moves to Canceled state.

The figure shows the states a chart can be in, and how it flows from one state to another

images/download/attachments/1704269/SFCStates.PNG

Next ...