Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Data Point not plotting in the graph - InfluxCloud DB #12

Closed
vimalgupta opened this issue Feb 18, 2020 · 16 comments
Closed

Data Point not plotting in the graph - InfluxCloud DB #12

vimalgupta opened this issue Feb 18, 2020 · 16 comments
Assignees

Comments

@vimalgupta
Copy link

Hi,
I a trying this plug-in with grafana and using influx cloud DB database.

I am unable to see any data point s drawn.

can you please guide me how can I use it with influx cloud DB.

below is my output of the query.
,result,table,_time,_value,_field
,_result,0,2020-02-18T07:27:58.853339466Z,17.4632916,lat
,_result,0,2020-02-18T07:27:58.853864976Z,17.4632916,lat
,_result,0,2020-02-18T07:28:58.017188544Z,17.4632916,lat
,_result,0,2020-02-18T07:28:58.017295643Z,17.4632916,lat

@ursweiss
Copy link

Hi,

I ran into the same problem and spent hours (literally...) to finally find out.

I use a single query like this:
SELECT "time" AS "time_index", "latitude" AS "lat", "longitude" AS "lon" FROM "state" WHERE ("entity_id" = '<you entity_id>') AND $timeFilter GROUP BY time_index fill(null)

The most important thing is to set the "Format as" to "Table" and not "Time series", or it will never work.

This hint should probably be added to the README, as many use Grafana with a TSDB.

@Drazair
Copy link
Contributor

Drazair commented Apr 28, 2020

@vimalgupta, have your problem been fixed?

@ursweiss, I'll make it more clear in the readme

@viktak
Copy link

viktak commented Nov 6, 2020

Hi,
I'm also having difficulties with this. Even editing is difficult, as when I make an error in the query I get an error page, with no option to go back and edit further - I have to restart from scratch:


An unexpected error happened
Details:
TypeError: this.events is undefined
    in t
    in x
    in co
    in div
    in div
    in t
    in t
    in div
    in ai
    in div
    in div
    in xo
    in div
    in t
    in div
    in t
    in div
    in div
    in t
    in x
    in div
    in t
    in x
    in r
    in Unknown
    in t
    in Unknown
    in h
    in Unknown
    in Unknown
    in t
    in t
    in l

@Alkarex
Copy link
Member

Alkarex commented Nov 6, 2020

@viktak Is that with our latest release 2.1.0 ?

@viktak
Copy link

viktak commented Nov 6, 2020

@Alkarex

Thanks for asking. I just checked and I see version 1.2.5.... I just assumed that the latest one got pulled as I just upgraded Grafana too to 7.3.1. Using Docker.

Is the official one in the Grafana Plugin list still the old one? Should I install it directly from git?

@viktak
Copy link

viktak commented Nov 6, 2020

@Alkarex And kudos to you for the super fast reply! 👍

@Alkarex
Copy link
Member

Alkarex commented Nov 6, 2020

Our branch 1.x is for Grafana 6, while our branch 2.x is for Grafana 7+.
Our new branch 2.x is currently under review grafana/grafana-plugin-repository#766 (you can give it a 👍) so for now you have to pull our release manually.

@viktak
Copy link

viktak commented Nov 6, 2020

Is this the correct link?
https://github.com/alexandrainst/alexandra-trackmap-panel/archive/2.1.0.zip

Your link gives me a version of 2.0.0 (although the title says 2.1.0)

I installed 2.1.0 and so far it doesn't show the error page as before, but I still have to figure out how to get my maps back :)

I expect to figure it out in a few minutes, and then I'll report back!

@Alkarex
Copy link
Member

Alkarex commented Nov 6, 2020

Yes, that is correct

@viktak
Copy link

viktak commented Nov 6, 2020

Can't seem to make it work...
This is my query (stolen/adapted from @ursweiss ):
SELECT "time" AS "time_index", "latitude" AS "lat", "longitude" AS "lon" FROM "autogen"."device_tracker.XXX_galaxya5" WHERE ("entity_id" = 'XXX_galaxya5') AND $timeFilter GROUP BY time_index fill(null)
I set Format as Table.

when the query runs with Table visualization, it displays the timestamps and coordinates, although the coordinates only show the integer part. This is a sample row:

1604592858204 47 18

When I switch visualization to Track Map, I only see an empty map centered on Aarhus, Denmark (which is not even the "integer" coordinates).

@viktak
Copy link

viktak commented Nov 6, 2020

I got it working, thank you for the help!
Here comes the proof:
vtracker-sample-log-on-map

I have noticed though, that now the map can center on the first or the last point (which is great), but I cannot make the map center/zoom on the "action". In the previous version, by default, it zoomed just enough to show all the points in the track. Is this option still available somewhere?

@viktak
Copy link

viktak commented Nov 6, 2020

While we are at it:
The documentation says this:
To add text tooltips to the markers, a text ordesc field should be added. If no tooltip exists in the data, latitude and longitude are displayed as the tooltip.
I tried it, and I can display a number of things, but not the timestamp. After some research I seem to think that selecting the Time field in InfluxDB is not possible. Is there any workaround/trickery to make this possible? Having a timestamp, in my opinion, is probably the most common/useful "extra" in the tooltip.

@viktak
Copy link

viktak commented Nov 8, 2020

Also, some kind of formatting would be essential: What I mean is, now I can display a number, say the speed, in the tooltip, but only as it is, a number. I would like to display it as xx km/h, rather than just XX.

Maybe I just haven't figured it out?

In Grafana I tried using transformations, but I couldn't get it to convert the speed value to string and then concatenate it with the unit.
Any ideas?

@j-or
Copy link
Collaborator

j-or commented Nov 17, 2020

@viktak FYI I've just added zooming in on the "action" (i.e. setting the map to fit all the positions on load) with #37. Try it by enabling "Zoom map to fit data bounds".

@Alkarex Alkarex closed this as completed Mar 2, 2021
@viktak
Copy link

viktak commented Mar 3, 2021

@Alkarex Thank you for the update!
Where do I find that Zoom map to fit data bounds option? I just upgraded my plugin to 2.2.0, but I can't seem to find it...

@viktak
Copy link

viktak commented Mar 3, 2021

@Alkarex Never mind, I found it. I just didn't see it because another one was active.
Thanks again it's a great plugin!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants