made some javascript for responsive graphs