How to extract data in a plugin

I am trying to undestand how to develop a plugin. I followed both parts of the tutorial of this webpage with success.

Now I am trying to visualize one value stored in influxDB. How can I do it? I am trying to make a plugin similar to Singlestat, but more simple in order to understand how the connection between influxdb and Grafana works.