gerate graph from data