Page 1 of 1

Filter data on google charts extension

Posted: Mon Feb 27, 2023 2:05 pm
by marcin_kor
hello, I'm trying to create a chart from mysql database using google charts extension (paid), but not really, is it possible to use date parameters from datapicker and combobox in where condition (mysql filter)?

marcin

Re: Filter data on google charts extension

Posted: Mon Feb 27, 2023 2:29 pm
by Pablo
There is no standard solution for this, this will require a custom script.

Re: Filter data on google charts extension

Posted: Mon Feb 27, 2023 5:24 pm
by marcin_kor
So this mysql filter can only contain a statically typed condition, no variable can be used there (in a non-script solution)?

Re: Filter data on google charts extension

Posted: Mon Feb 27, 2023 5:55 pm
by Pablo
The filter will be added as 'WHERE' clause, so technically it can also be a PHP variable.
$sql = "SELECT * FROM `TABLE` WHERE $filter";

Re: Filter data on google charts extension

Posted: Mon Feb 27, 2023 6:22 pm
by marcin_kor
Thanks for the info.

marcin