Get data from monitored SQL DB and Graph

Does anyone know how I could get the data from a query on a table into a graph in APM?  I have the query set up and it returns an "available", but I need to have the data the query results in graphed as the result.  Any ideas?

APM v3.1