Okay
  Public Ticket #2139658
Filtering charts
Closed

Comments

  •  3
    Jose Luis started the conversation

    Hi,

    I am using Powerful filters to pre-filter a very large table. I hide the table until the selection is made (2 or 3 filters in cascade), and then I show the table.

    Given that the filtered section is still large, I need to use server-side processing.

    However, I also need to show a chart below the table, representing the filtered selection, but I found that the number of rows displayed also affect the chart.

    That is, even though the cascade filters selection was made, the number of displayed rows act as a new filter for the chart....(what shouldn`t happen...).

    How can avoid the number of displayed rows to affect the chart, and just get the chart show what I filtered using powerful filters?

    Thanks,

    Jose Luis 


  •  2,572
    Aleksandar replied

    Hello Jose.

    This is the default behavior of charts when you enable "Follow table filtering".

    It is explained in our documentation:

    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.

    So, the charts responding only with the values of rows currently displayed is because Server-Side fetches only those rows needed on the page at the exact moment. By default, it equals to the number of rows that administrator defines for the table in the “Display length” setting; the front-user can however, change it. For example: if the table is configured to show 10 rows by default, only 10 rows would be queried from MySQL. When the user switches to the next page, and sorts the table by some column, or filters by some column, an AJAX-request is sent to the server, the query is processed by MySQL, and 10 more rows are returned. Consequently, all filtering, sorting, pagination, and other data processing routines will be delegated to the MySQL engine, and only a smaller number of rows will be fetched from the server by a background AJAX request at a time.

    So, unfortunately, if you enable "Follow table filtering", the charts will follow both the filters, and the number of rows currently displayed on the page.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [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