--- 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 chart will enter Canceling state. ## Client Permission Restrictions [Permission Type](projects\project-properties\project-properties.md#client---permissions): 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 ### Throws Will throw a KeyError if the ID does not match any running chart instance. ### Scope All ## Code Examples ```python title="Example #1" # The following will attempt to stop an SFC but will alert the user if the id of the chart is not currently running id = 'Some long string value obtained from earlier in the script' try: system.sfc.cancelChart(id) except: system.gui.messageBox("Could not stop the SFC") ```