grafana / worldmap-panel

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

InfluxDB unable to display data in table format #236

Closed thomas-tf closed 4 years ago

thomas-tf commented 4 years ago

I am using Grafana 6.4.1 and WorldMap panel 0.2.1

I have the following data already in my influxDB. Time: timestamp id: the ID number of a car latitude: - longitude: - value: a dummy field to make all data points the same size. image

WorldMap Panel settings: Query (Same as the one for the above table): SELECT "lat" AS "latitude", "lon" AS "longitude", "value" AS "value" FROM "taxi_trajectory" WHERE $timeFilter GROUP BY "id" LIMIT 1

image

Query inspector: image

I have tried many ways, such as query without groupby, adding a dummy country and groupby with it, etc. Still doesn't work. Map is displayed but there's no data points.

image

amotl commented 4 years ago

Dear Thomas,

your configuration looks reasonably. These things come to my mind:

  1. LIMIT 1 might give you just a single data point. Does stripping that suffix away from the query expression help?

  2. Please also be aware you should maybe save your dashboard and force a complete browser refresh -- at least once after creating the panel. I believe I have experienced similar issues in the past especially after fiddling with the parameters too heavy.

With kind regards, Andreas.

thomas-tf commented 4 years ago

Dear Thomas,

your configuration looks reasonably. These things come to my mind:

  1. LIMIT 1 might give you just a single data point. Does stripping that suffix away from the query expression help?
  2. Please also be aware you should maybe save your dashboard and force a complete browser refresh -- at least once after creating the panel. I believe I have experienced similar issues in the past especially after fiddling with the parameters too heavy.

With kind regards, Andreas.

Thanks for your quick reply. To answer your suggestions.

  1. LIMIT 1 is to simply limit the result to 1 row for each car. I have also tried stripping it away and it doesn't help.
  2. Saved dashboard, refreshed page, re-opened browser. None of them help.
amotl commented 4 years ago
  1. Did you configure the metrics query in "table format" actually? Sorry for asking, I am just trying to make sure everything is configured appropriately.
thomas-tf commented 4 years ago
  1. Did you configure the metrics query in "table format" actually? Sorry for asking, I am just trying to make sure everything is configured appropriately.

Yes. image Also tried to remove the where clause

amotl commented 4 years ago
  1. The latitude and longitude fields might have to be InfluxDB tags actually.

Records like these (here using geohash instead of lat/lon) work for us.

image

The corresponding metrics query is

SELECT last("particulate-matter-2-5-m") AS "metric" 
FROM "irceline_readings" 
WHERE $timeFilter GROUP BY "geohash", "station_id"

In your case, just forget about station_id and rename metric to value.

thomas-tf commented 4 years ago

image

image

Tried just now. Doesn't work.

Edit: Also tried to rename tag name as "latitude" and "longitude". Doesn't help.

thomas-tf commented 4 years ago

Just now I transformed the lat, long coordinates into geohash then store into influxdb. The settings look totally fine but it still doesn't show any data points. image

thomas-tf commented 4 years ago

Problem solved by upgrading grafana from 6.4.1 to 6.4.2

Thank you for your help @amotl

image

amotl commented 4 years ago

Dear Thomas,

Problem solved by upgrading grafana from 6.4.1 to 6.4.2.

Ah, you have been bitten by Grafana 6.4.0 breaking Worldmap (#223). Sorry that I missed this important detail.

Good that it is working for you now. If you feel like you could need more features from Worldmap, you might want to look at our fork where we've put in some sensible improvements already [1,2,3].

So, you might want to close this issue. Have fun with all of your mapping.

With kind regards, Andreas.

[1] https://github.com/panodata/grafana-map-panel [2] https://community.grafana.com/t/giving-the-grafana-worldmap-panel-some-love/17210 [3] https://community.hiveeyes.org/t/grafana-map-panel-ng/1824