title: Grafana graphing with Postgres JSON datatype not working
body: <p>I'm setting up Grafana for a internal dashboard for the company I work at. We have a phone system that we track, and have metrics saved in a database. I've extracted key metrics and stored them on a Postgres database. Here is what it looks like:</p>
  
  <pre><code>postgres=# SELECT * FROM phonedata LIMIT 5;
   id |    date    |                                       data                                       
  ----+------------+----------------------------------------------------------------------------------
   16 | 2019-05-27 | {"avgDuration": "608", "avgQueuetime": "0:02:46.716667", "voicemailCount": "6"}
   17 | 2019-05-26 | {"avgDuration": "676", "avgQueuetime": "None", "voicemailCount": "0"}
   18 | 2019-05-25 | {"avgDuration": "506", "avgQueuetime": "0:01:32.684211", "voicemailCount": "1"}
   19 | 2019-05-24 | {"avgDuration": "540", "avgQueuetime": "0:02:14.784091", "voicemailCount": "11"}
   20 | 2019-05-23 | {"avgDuration": "616", "avgQueuetime": "0:03:09.433962", "voicemailCount": "10"}
  (5 rows)
  </code></pre>
  
  <p>This data shows the statistics for the date as shown in the "date" column. This all works fine. I have data for the last 90 days so there is no problem with lack of data.</p>
  
  <p>Now I'm trying to make a graph on Grafana that shows the average duration of a phone call per day, bit I can't get it working.</p>
  
  <p>Here is a link to a image of the code I have written and the graph on Grafana. StackOverflow won't let me post the image directly</p>
  
  <p><a href="https://i.imgur.com/3uQe9t5.png" rel="noreferrer">https://i.imgur.com/3uQe9t5.png</a></p>
  
  <p>Here is the code written out:</p>
  
  <pre><code>SELECT
      date AS "time",
      data-&gt;&gt;'avgDuration'::VARCHAR as "values"
  FROM
      phonedata
  WHERE
      $__timeFilter(date) AND
      data-&gt;&gt;'avgDuration' NOT ilike 'None'
  ORDER BY 1
  </code></pre>
  
  <p>I feel like I'm very close but not quite there yet. I have tried many different variations on this but can't figure it out.</p>
  
  <p>Any help would be tremendous.</p>
  
  <p>Thanks</p>
  
  <p>(I'm running Grafana v5.4.2 (commit: d812109))</p>