Okay
  Public Ticket #3391142
Dynamic filtering
Closed

Comments

  • Raffaele Tatullo started the conversation

    Hi,

    I am trying to build a dynamic chart, I went  through the FAQ but I can't find a solution.

    I am trying to do chart that has a date as x-axis and indexed performance as Y-axis. This means that the chart starts from 100 as Y-axis.

    I would like to have a filter on the date that changing the initial period, it ricalculates all the performance.

    Just to give an example if I have 3 date January, February and March with performance 100,200 and 300 if I filter just February and March I get 100 and 150 (300/200*100).

  •  1,848
    Miloš replied

    Hi, Raffaele.

    If i understood, you need to have a dynamic filter on a page with data on a Chart,

    and to have the Chart respond to the filter?

    There is a workaround i will share, that you can use in order to have the chart respond to filtering like that.

    -

    By default, the charts will not follow any filtering from their source table if you just put the chart "on its own" on the page.

    But If you place the source table together with its chart on the same page,

    and activate " Follow Table filtering"  on the chart Wizard settings,  it is going to follow any filtering/sorting you do on the table.

    -

    Now, depending if you wish to hide the table and have a filtering for Charts, we can have two workarounds available.

    1. If you wish to hide the entire table along with table filters;

    you can add this CSS to the table's back-end settings/Customize/Custom CSS.

    .wpdt-c .wpDataTables.wpDataTablesWrapper {
    display: none !important;
    }

    This will completely hide the table from the page, but you can still pass the table shortcode with the chart, and you will get the "follow table filtering" effect on this chart.

    2. Or if you wish just to hide the table while leaving the filters with the chart,

    we would first need to disable the following in the table settings:

    "Show X entries" drop-down; "Info Block" from Display tab:

    5739555450.png

    Then, "Enable main search block"  and "show filters in a form above the table" from the Sorting and Filtering tab:

    7822122957.png

    Then, you can add this CSS in the table settings/Customize/Custom CSS:

    .wpdt-c .wpDataTablesWrapper table {
    display: none !important;
    }
    

    That will just leave the chart visible with the filters on the page,

    if you pass both table and chart shortcodes.

    Let us know if that helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables