creating the graph from MySQL