added function to get graph data