moved graph generation to php