create graph from data