Fetch data of graph from ajax