Create query result

When query is executed results are given back in html form and this result needs to be in expressed    in a graph form? This where the open code needs to forked ,to give final result