adding scaleGraphs function to js for responsive layout