Allow to enable/disable graphs

js rewritten partially  to be sure that /api/config has been load first.