javascript fix for the graphs