first graph in pure javascript