> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.carbone.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to hide charts conditionally


# How to hide charts conditionally

Since Carbone `v4.3.0`, the `drop` formatter is available to delete charts and any element from a document. Be sure to request version 4 (or higher) of Carbone:
* For the Cloud API: set the header `"carbone-version":4`
* For the Cloud Studio: Click on the top-right "settings" icon > click on "version" > Select `4.X.X`.

| Learn more about `:drop` formatter on the [documentation](https://carbone.io/documentation/design/conditions/smart-conditions.html#drop-keep-element)

For the following exemple, we want to drop a chart if a dataset is empty.
Include the Carbone tag `{d.values:ifEM:drop(chart)}` within a shape alternate text, title or description.
* the `d.values` is a list of values to create a chart, coming from a JSON dataset
* the `:ifEM` is a conditional formatter checking if the list is empty.
* the `:drop(chart)` formatter is fired if the previous condition is true. The first argument `chart` is required to defined the element to drop.

Locations to insert tags for:
* **LibreOffice**: Right click on the chart > properties > `Option` tab > Insert the drop expression `{d.values:ifEM:drop(chart)}` in the name, text alternative or description field
* **MS Word**: Right click on the chart > click on "edit alt text" >  insert the drop expression `{d.values:ifEM:drop(chart)}`

![DOCX template edited with MS Word](https://storage.crisp.chat/users/helpdesk/website/f355e91d7615e000/screenshot-2022-09-09-at-18314_v9xqi9.png)