Okay
  Public Ticket #3372170
Data Chart with placeholders
Closed

Comments

  •  1
    Erez started the conversation

    Hi,

    I read this page on your documentation.

    1) Can I use a chart that is based on an SQL-based data table wich has placeholders and set the placeholders for the chart?

    2) When using the "follow table filtering" option for the chart. I would like to:
    a) Hide the table (Show only the chart).
    b) Show the filters above the chart.

    Is is possible? How?

    Thanks!


  •  1,702
    Miloš replied

    Hi, Erez.

    Yes, this is possible, we will explain how you can achieve it.

    Just a side note, for pagination for charts.

    For example, if you need the chart to show data from all rows, rather than just the first page of an SQL Table.

    The charts are being created based on tables. If the table is server-side enabled, then only the rows shown in the table will be loaded on the chart.

    If the table is non-server-side, the chart will load all the rows, unless we enable "Follow table filtering" with the table on the same page.

    -

    Basically, if you have a Manual table; they have automatically server-side enabled, we can't disable it.

    So you would have to make another SQL Query based table, to pull data out of the Manual Table;

    then you have to disable server-side processing for it;

    and disable "Follow table filtering" - then the chart will load all rows ( if needed).

    -

    Now, about the main question you asked, how to get filtering for a chart with placeholders on the table,

    while hiding the table and just having filters with the chart :


    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 me know how it goes.smile.png

    Thanks.



    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    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