Okay
  Public Ticket #2695897
charts not appearing
Closed

Comments

  •  1
    ess (they/them) started the conversation

    Table-following charts not appearing after last update

  • Luis Ángel replied

    Yes, following this ticket! I posted another ticket (https://tmsplugins.ticksy.com/ticket/2693344/) where I report the same issue but they haven't replied yet. Let's hope it gets solved soon.

  •  2,507
    Aleksandar replied

    Hello ess and Luis

    Luis, I can see you're already working with Milan on your ticket, so he'll get to you as soon as possible.

    ess - We have a bug in the last version of the plugin, when "Follow table filtering" is enabled.

    Please go to file wp-content/plugins/wpdatatables/source/class.wpdatachart.php and on line 2706 you will find this

    if ($this->getFollowFiltering()) {

    add this code at the end of that if statment:

    if (get_option('wdtIncludeBootstrap') == 1) {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                } else {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/noconf.bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                }
                wp_enqueue_script('wdt-bootstrap-select', WDT_JS_PATH . 'bootstrap/bootstrap-select/bootstrap-select.min.js', array(), WDT_CURRENT_VERSION, true);
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_settings', WDTTools::getDateTimeSettings());
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_frontend_strings', WDTTools::getTranslationStrings());
    

    So your code looks like this:

    if ($this->getFollowFiltering()) {
                wp_enqueue_script('wdt-common', WDT_ROOT_URL . 'assets/js/wpdatatables/admin/common.js', array('jquery'), WDT_CURRENT_VERSION, true);
                if ($minified_js) {
                    wp_enqueue_script('wdt-wpdatatables', WDT_JS_PATH . 'wpdatatables/wdt.frontend.min.js', array('wdt-common'), WDT_CURRENT_VERSION, true);
                    wp_localize_script('wdt-wpdatatables', 'wdt_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php')));
                } else {
                    wp_enqueue_script('wdt-datatables', WDT_JS_PATH . 'jquery-datatables/jquery.dataTables.min.js', array(), WDT_CURRENT_VERSION, true);
                    wp_enqueue_script('wdt-funcs-js', WDT_JS_PATH . 'wpdatatables/wdt.funcs.js', array('jquery', 'wdt-datatables', 'wdt-common'), WDT_CURRENT_VERSION, true);
                    wp_enqueue_script('wdt-wpdatatables', WDT_JS_PATH . 'wpdatatables/wpdatatables.js', array('jquery', 'wdt-datatables'), WDT_CURRENT_VERSION, true);
                }
                if (get_option('wdtIncludeBootstrap') == 1) {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                } else {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/noconf.bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                }
                wp_enqueue_script('wdt-bootstrap-select', WDT_JS_PATH . 'bootstrap/bootstrap-select/bootstrap-select.min.js', array(), WDT_CURRENT_VERSION, true);
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_settings', WDTTools::getDateTimeSettings());
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_frontend_strings', WDTTools::getTranslationStrings());
            }
    

    Then, in file wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.googleCharts.js around line 210 you will find this

    if( typeof google.visualization.DataTable !== 'undefined' && this.chart != null ){

    and you will need to replace it with this:

    if( typeof google.visualization !== 'undefined' && typeof google.visualization.DataTable !== 'undefined' && this.chart != null ){

    Also, you need to turn off minify JS on CUSTOM JS AND CSS tab in plugin settings and to clear browser and server cache.

    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