separate js from php, charts called with ajax and json