Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show details on grafana point hover

Tags:

grafana

I am using Influxdb as my source with grafana. On my time series for each data point I have several values and tags.

  • How can I show related data points on hover of particular data point in a line chart?
  • Alternatively can I call some API passing some value to populate this tooltip that comes up on hover.

Show additional details on hover

like image 276
DMin Avatar asked Oct 16 '17 02:10

DMin


1 Answers

As of this writing it cannot be done, however there is a workaround that will work for a few (but not many) cases.

If you can structure your query so that it arrives in a table with three columns - time, metric and value then Grafana will use the value in the metric column as the series name and show it in the tooltip. If you can squash your value into that field, it can work.

For example:

SELECT
    xxx AS "time",
    CONCAT(name, ':', extra_content) AS metric,
    yyy AS value
FROM ...

To make this work you will need to hide the legend otherwise it will show many series and look cluttered, which means this solution won't work for many cases.

Here is a screenshot showing how I was able to squash an extra date into the metric name. The position on the graph is the date of the data point, and the second date in the metric name shown in the tooltip is the date that the data was obtained from the source.

Example tooltip

like image 95
Malvineous Avatar answered Nov 04 '22 21:11

Malvineous