grafana / worldmap-panel

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

TypeError: this.datapoints is undefined #331

Open rsiddle opened 2 years ago

rsiddle commented 2 years ago

Versions Grafana: 8.0.3 Worldmap-panel: 0.3.3 Datasource: TimescaleDB

Query format: Timeseries

The following query used to work with Grafana 7.X.X and Worldmap-panel 0.3.2.

The country returns a 3 letter country code as shown in the data/countries_3letter.json file. I believe the problem appears to be that the data source no longer returns the result as expected by the plugin with multiple data points.

SELECT
date as time,
country as metric,
count(country) as total
FROM entries
WHERE
  date BETWEEN '2021-08-05T10:06:29.165Z' AND '2021-08-12T10:06:29.165Z'
  AND profile in (
      'https://example.com'
  ) 
GROUP BY date, country, metric
ORDER BY date

When isolating the query to return only one country, in the example below, "Japan" (jpn), it works as expected, with the caveat being it only shows one data point.

SELECT
date as time,
country as metric,
count(country) as total
FROM entries
WHERE
  date BETWEEN '2021-08-05T10:06:29.165Z' AND '2021-08-12T10:06:29.165Z'
  AND profile in (
      'https://example.com'
  ) 
  AND country = 'jpn'
GROUP BY date, country, metric