DataHover events from TimeSeries plugin is empty

Good afternoon Grafana Community!

I’m developing my own plugin and need to handle DataHoverEvent both ways: process events from other panels and emit one from my plugin itself.
However, I’m facing an issue with DataHoverEvent.

Receive events:
I’m using TimeSeries panels and I receive empty DataHoverEvents.

Screenshot 2023-09-06 193919

I get only relative y value. But I need hovered time, so at least a relative x value will do the job.
How come other fields are empty? Even though data is populated correctly.

Send events:
I’m trying to emit a DataHover event with different data via eventBus.publish() function but it is not reflected on other panels

Grafana version: v9.1.4

(I’ll try a newer version once I manage to build one :wink: )

There’s not much info regarding this stuff online so I would appreciate any help.
Thanks in advance!

1 Like

Here is my PostgreSQL query from TimeSeries panel by the way

SELECT
  $__time(time),
  velocity,
  'Actual velocity' as metric
FROM
  velocity_actual
WHERE
  $__timeFilter(time)
  AND
  vehicle_id = '$vehicle_id'
ORDER BY time ASC

i’m facing the same problem so i hope there’s someone that can help us…

Try this

SELECT
  $__time(time) as time,
  velocity as value,
  'Actual velocity' as metric
FROM
  velocity_actual
WHERE
  $__timeFilter(time)
  AND
  vehicle_id = '$vehicle_id'
ORDER BY time ASC

Hi!
Thanks for your reply. Didn’t help unfortunately

$__time(time) as time for some reason results in an error
db query error: pq: syntax error at or near "as"

This is the query that worked

SELECT
  time as time,
  velocity as value,
  'Requested velocity' as metric
FROM
  velocity_requested
WHERE
  $__timeFilter(time)
  AND vehicle_id = '$vehicle_id'
ORDER BY
  time ASC

But result is the same unfortunately

1 Like

@nikolaikorniichuk did you find any solution?
I am using Grafana 9.5.13 and facing the same problem.