Okay
  Public Ticket #1010253
following table filtering in datachart not working
Closed

Comments

  •  2
    tarekreslan started the conversation

    i created a datatable with mysql query as its data source, and added two where conditions to filter the records based on the date, and the datatable is working fine and returns data correctly, after that i created a datachart with the created datatable as its source, and checked the following table filtering checkbox, but the chart is returning no data, if i remove the filter from the query in the datatable, the chart works fine. please advice

  • [deleted] replied

    Hi tarekreslan,
    Thank you for your purchase.

    Please send me the ID of your table. Also please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here because this ticket is private and nobody can see it except us.

  •   tarekreslan replied privately
  • [deleted] replied

    Hi tarekreslan,

    Please update wpDataTables to version 1.7 because you are using version 1.6.2. Also today should be available version 1.7.1 on CodeCanyon and you can wait few hours and update it to 1.7.1. If it's not working after that I will log in and take a look.

    If you are updating it manually please take a look this link how you should update it - http://wpdatatables.com/documentation/general/updating-wpdatatables-manually/

    If you are updating it automatically you'll have to add purchase key on wpDataTables settings page.

  •  2
    tarekreslan replied

    I updated wpDataTables to version 1.7 but still the filter isn't working.


    regards,

    Mohammad Abboud

  • [deleted] replied

    Hi tarekreslan,

    As I see table with ID 75 is not fetching any data from MySQL ad because of that it's not working. Also when you are using complex queries like this it is better to create MySQL View in the database from this query and use that MySQL View as table input.

    Maybe it is not fetching any data because I didn't add variables that you used? Do you have any example where this table works?

  •  2
    tarekreslan replied

    Yes you can check the chart ID 13, the query is configured with variables, but following the filter is also not working.

    Regards,

    Mohammad Abboud

  • [deleted] replied

    Hi tarekreslan,

    I have created new table and new chart and everything is working fine. Maybe there is a problem with table with ID 75. It's not working at all for me. There is not any data.

    Here you can see example with table and chart where follow table filtering works:

    http://www.ppma.gov.lb/en/?page_id=14302&preview=true

    Table ID i 96 and Chart ID is 22

  •  2
    tarekreslan replied

    maybe I didn't get the idea behind follow table filtering feature, here's what I'm trying to accomplish, I have a datatable that takes two variables VAR1 and VAR2 as a date range, the data in the query are filtered by date as from(VAR1) and to(VAR2), i want the user to enter the date range and submit to filter the chart, I'm printing the chart using the following: echo do_shortcode("[wpdatachart id=13 var1='".$fromDate."' var2='".$toDate."']") , where I'm passing the date that the user selects, this filter is not working.


    Regards,

    Mohammad Abboud
     

  • [deleted] replied

    Hi tarekreslan,

    Unfortunately it is not possible to use variables in chart shortcodes, but you can enable follow table filtering feature for chart and put it together on the page with table from that you created chart. Like that variables from table shortcode be implemented in chart. You can take a look at Chart follow table filtering on this link from our documentation.

  •  2
    tarekreslan replied

    Dear,

    Okay then I'll try using both the chart and the table, but this might be difficult since I have 8 charts in one page.

    I have and issue with the chart design, when I have many values in the x-axis, the values will overlap, how can I fix this, you can check the charts in the following page http://www.ppma.gov.lb/ar/statistics/ the bar charts are n the 3rd and 4th accordion.

    Regards,

    Mohammad Abboud

  • [deleted] replied

    Hi tarekreslan,

    For bar charts, you can put them one below another one, and check Responsive option in chart wizard for these charts. Like that letter will not overlap and chart will take 100% width of the container.

  •  2
    tarekreslan replied

    I did put the charts one below the other and selected the responsive option, but still the letters are overlapping, and the chart is not taking 100% width unless I resized the browser.

    regards,

    Mohammad Abboud

  • [deleted] replied

    Hi tarekreslan,

    Problem with this is because div where chart should be rendered is invisible and then Google chart library can't calculate width of that div. I've added two Charts (Highchart and Google chart) on this draft page - Link. These two chart have Responsive option enabled, but because div where are these charts is visible, charts are taking full width.

    Something that you can try is to put these charts outside of hidden divs, or maybe to use Highcharts but I am not sure they will work in hidden divs also.

  •  2
    tarekreslan replied

    Dear,

    I'm need to create a datatable with 4 variable placeholders, is it possible? how could I add another variable placeholder?

    Regards,

    Mohammad Abboud

  • [deleted] replied

    Hi Mohammad,

    Unfortunately it is not possible to use 4 variables out of the box. Something like that requires customization of the plugin core files and adding one more row in database wp_wpdatatables table. 

    However if you are interested to add 4th variable you have to search for $wdt_var1 in plugin files and see how this variable is added. If you are doing this kind of custom coding be aware that if you update the plugin all changes that you have made will be overwritten after update.

  •  2
    tarekreslan replied

    I already update the files and added a new placeholder $wdt_var4, the problem that I'm facing is that I might need to recreate all the tables in-order for the 4th variable to work correctly.

    Regards,

    Mohammad Abboud

  • [deleted] replied

    Hi Mohammad,

    Probably you have to recreate these tables, but firstly you'll have to check if there is var4 column in wp_wpdatatables table in the database, and when you save %VAR4%  from the wpDataTables table settings does it store that value in the database in wp_wpdatatables table.

  •  2
    tarekreslan replied

    Dear,

    Kindly note that the charts created are not showing on IE browser, I'm getting the following errors in console, "Unable to set property '_DT_CellIndex' of undefined or null reference" and "Unable to get property 'fnDraw' of undefined or null reference".

    Please advise.

  • [deleted] replied

    Hi tarekreslan,

    What version of IE browser are you using?

  •  2
    tarekreslan replied

    IE 11

  • [deleted] replied

    Hi Mohammad,

    Can you send me again link with your charts so I can take a look?

  •  2
    tarekreslan replied

    Kindly find below the link to the charts page:

    www.ppma.gov.lb/ar/statistics/

  • [deleted] replied

    Hi Mohammad,

    Did you use Custom Page Templates for creating these pages and adding shortcodes directly in the template? If answer is yes, please send me your FTP login credentials so I can see you charts and tables on this page. Just check PRIVATE so nobody can see it except us.

  •   tarekreslan replied privately
  • [deleted] replied

    Hi Mohammad,

    I understand, this is a state secretObviously there is a problem with some of the tables. Can you try to remove them one by one and see if JavaScript error still persists. You can see JS errors when you open developer console. I would suggest you first to remove wpdatatable id=77 because that table is using row grouping and maybe this is causing the issue.

  •  2
    tarekreslan replied

    Dear,

    In the troubleshooting process, I removed all the charts and datatables, and printed only one chart, the chart didn't appear on IE, but there was no errors on the console.

  • [deleted] replied

    Hi tarekreslan,

    The problem is the same as before when you placed charts in hidden accorditions. Problem with IE is probably because it tries to create a chart before accordition element is created. Can you try to put chart outside of accordition and see does it work in IE browser?

  •  2
    tarekreslan replied

    Dear,

    The chart is not working even if there was no accordions in case of IE.

    Regards,

    Mohammad Abboud

  •  2
    tarekreslan replied

    Any update please?

    Regards,

    Mohammad Abboud

  • [deleted] replied

    Hi tarekreslan,
    Sorry for delayed reply. Your ticket was very old and because of that I didn't see it.

    I see charts on the page on Internet Explorer. You can take a look at the image from the attachment.