Follow table filtering in charts

Video versionA video overview of follow table filtering in charts

Follow table filtering in ChartsRedraw the chart on any filtering action with the table

Charts in wpDataTables have a very useful feature: if charts are rendered on the same page with a table, they can re-render when the table is filtered using the Advanced Filter.

This can be helpful if you want to allow users to visualize only some part of a table data: e.g. activity only for a certain product type, or for a certain date range. Also this is useful if the table is quite large, and has the ‘server-side processing‘ feature enabled; since rendering the chart for many thousands of rows would overload both the chart and the page.

Follow table filtering option

It is quite simple to activate the follow table filtering for a chart. Just tick this checkbox in the chart create/edit wizard:

When the checkbox is ticked, and the settings have been saved, you can place the chart in the same post or page with your WordPress table. Then, when you filter the table, the data in the chart will be filtered as well:

To filter, sort or change the page in the table:

And see how the chart changes:

It also works if multiple charts are on the same page (even rendered by different engines).