--- title: "system.sfc.cancelChart" description: "Cancels the execution of a running chart instance." --- # system.sfc.cancelChart > Cancels the execution of a running chart instance. This function is used in **Python Scripting**. ## Description Cancels the execution of a running chart instance. Any running steps will be told to stop, and the SFC chart will enter Canceling state. Will throw a KeyError if the ID does not match any running chart instance. ## Client Permission Restrictions [Permission Type](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties): SFC Management Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope. ## Syntax `system.sfc.cancelChart(id)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `id` | The ID of the chart instance to cancel. ### Returns Nothing ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # The following attempts to stop an SFC but will alert the user if the id of the chart is not currently running. id = 'Some long string value. It can be obtained using system.sfc.getRunningCharts()' try: system.sfc.cancelChart(id) except: system.gui.messageBox("Could not stop the SFC") ```