grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
306 stars 200 forks source link

Render Map Without $__timeFilter? #307

Closed ssnkhan closed 3 years ago

ssnkhan commented 3 years ago

Hi there,

I am trying to get the plugin to work using an underlying sqlite database. time (as below) is a unix epoch, and I am correctly setting the country codes and values to metric and value. Despite this, I am unable to get this to work, despite the Query editor returning the appropriate rows:

Grafana Query

The query I have so far is:

SELECT
    strftime('%s', created_at) AS time,
    country_code AS metric,
    count(*) AS value
FROM artifacts
WHERE strftime('%s', created_at) > 0
GROUP BY
    metric
ORDER BY
    value DESC;

Unfortunately, the sqlitedb plugin does not support $__timeFilter which is what I have used in the past with this map plugin without issue. I am happy to sacrifice the dynamic data selection (i.e., $__timeFilter(time)), if I can get the map to draw anything at all, but the moment I move the WHERE clause, I get a Data error: TypeError: this.datapoints is undefined error.

If anyone has any thoughts as to how to get this working, I'd really appreciate it.

ssnkhan commented 3 years ago

Resolved -- time, metric and value fields are case sensitive.