---
title: "Pre-Filter a wpDataChart Using a VAR Placeholder"
description: "Apply dynamic filters to charts by linking them to a table with the VAR parameter"
url: https://help.wpdatatables.com/en/articles/51-pre-filter-a-wpdatachart-using-a-var-placeholder
collection: "Charts"
updated: 2026-05-31
language: en
---

# Pre-Filter a wpDataChart Using a VAR Placeholder

Apply dynamic filters to charts by linking them to a table with the VAR parameter

At the moment, it’s not possible to apply filtering **directly within a chart shortcode**.

This is because all [**advanced column filters**](https://wpdatatables.com/documentation/table-features/advanced-filtering/) and [**dynamic placeholders**](https://wpdatatables.com/documentation/table-features/using-placeholders/) (such as `VAR1`, `VAR2`, etc.) are designed to work **only with tables**, not with standalone charts.

That said, there’s a simple workaround you can use to pre-filter a chart using its source table on the same page.

* * *

### ✅ How to pre-filter a chart using a table + `VAR`

1.  **Place the table shortcode on the same page as the chart.**  
    You can use the same table across different pages, each with its own pre-filtered value by adding a dynamic placeholder like this:
    
    ```javascript
    [wpdatatable id=1 var1=your_value] 
    ```
    
    _(Replace_ `1` _with your actual table ID, and_ `your_value` _with the filter value you want.)_
    
2.  **Enable the** [**“Follow table filtering”**](https://wpdatatables.com/documentation/wpdatacharts/follow-table-filtering-in-charts/) option in the Chart Wizard.  
    This makes the chart respond to the filtered state of the table.
    
3.  **(Optional) Hide the table on the front-end.**  
    If you only want to display the chart, you can hide the table using CSS or our recommended method:
    
    👉 [How to filter the chart while hiding the table](https://help.wpdatatables.com/en/articles/30-filter-the-chart-while-hiding-the-table.md)
    

* * *

In the end, the chart will be pre-filtered using the `VAR` value passed through the table shortcode — and the table itself can remain hidden if needed.
