Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips don't display for most datapoints on graph and timeseries visualization #47795

Closed
cameronwaterman opened this issue Apr 14, 2022 · 10 comments · Fixed by #47906
Closed
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc

Comments

@cameronwaterman
Copy link
Contributor

What happened:

Tooltips don't display for most datapoints on graph and timeseries visualization. I've also seen a related issue where the plot doesn't display at all. See gifs below for both issues.

GrafanaTooltips

GrafanaPlot

What you expected to happen:

Tooltip would show for every datapoints and plot would show.

How to reproduce it (as minimally and precisely as possible):

Apply timeseries data to either of the above-mentioned visualizations and attempt to hover datapoints.

Anything else we need to know?:

Environment:

  • Grafana version: 8.4.5 (Fork)
  • Data source type & version: Custom datasource
  • OS Grafana is installed on: Alpine 3.15
  • User OS & Browser: Windows 10 / Chrome
  • Grafana plugins: Above-mentioned datasource
  • Others: N/A
@joshhunt
Copy link
Contributor

I'm unable to reproduce on https://play.grafana.org/d/igIv8Ww7k/47795-time-series-tooltips

Do you have a sample data CSV or dashboard that replicates the issue?

@joshhunt joshhunt added the bot/needs more info Bot will request more info label Apr 19, 2022
@grafanabot
Copy link
Contributor

Thanks for creating this issue! We think it's missing some basic information.

Follow the issue template and add additional information that will help us replicate the problem.
For data visualization issues:

  • Query results from the inspect drawer (data tab & query inspector)
  • Panel settings can be extracted in the panel inspect drawer JSON tab

For dashboard related issues:

  • Dashboard JSON can be found in the dashboard settings JSON model view

For authentication, provisioning and alerting issues, Grafana server logs are useful.

Happy graphing!

@grafanabot grafanabot added needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc and removed bot/needs more info Bot will request more info labels Apr 19, 2022
@grafanabot
Copy link
Contributor

Thanks for creating this issue! We think it's missing some basic information.

Follow the issue template and add additional information that will help us replicate the problem.
For data visualization issues:

  • Query results from the inspect drawer (data tab & query inspector)
  • Panel settings can be extracted in the panel inspect drawer JSON tab

For dashboard related issues:

  • Dashboard JSON can be found in the dashboard settings JSON model view

For authentication, provisioning and alerting issues, Grafana server logs are useful.

Happy graphing!

@cameronwaterman
Copy link
Contributor Author

Here is some additional info as requested. Inside the zip file you'll find the dashboard JSON and the data CSV.
Grafana_Issue_47795.zip

@mure
Copy link

mure commented Apr 19, 2022

Screen Recording 2022-04-19 at 11 45 14 AM
I was able to reproduce this on play.grafana using the TestData DB and CSV content. I can't save the dashboard, but here's the CSV I used.
Panel Title-data-2022-04-19 11_38_13.csv
I had to add a transform to convert the time column to be a correctly typed time field.

@leeoniya
Copy link
Contributor

leeoniya commented Apr 19, 2022

the data must be ordered time/ASC, but the data in the CSV is ordered time/DESC.

if you add a Sort by -> time transform, it works as expected, i think. here's the CSV content i used:

time,value
2022-04-19T11:23:07.504Z,89.5
2022-04-19T11:22:07.504Z,13.3
2022-04-19T11:21:07.504Z,42.5
2022-04-19T11:20:07.504Z,8.78
2022-04-19T11:19:07.504Z,7.85
2022-04-19T11:18:07.504Z,57.5
2022-04-19T11:17:07.504Z,9.78
2022-04-19T11:16:07.504Z,91.3
2022-04-19T11:15:07.504Z,84.8
2022-04-19T11:14:07.504Z,16.8
2022-04-19T11:13:07.504Z,1.65
2022-04-19T11:12:07.504Z,2.80
2022-04-19T11:11:07.504Z,25.2
2022-04-19T11:10:07.504Z,70.6
2022-04-19T11:09:07.504Z,11.6
2022-04-19T11:08:07.504Z,61.2
2022-04-19T11:07:07.504Z,38.2
2022-04-19T11:06:07.504Z,90.6
2022-04-19T11:05:07.504Z,92.8
2022-04-19T11:04:07.504Z,9.63
2022-04-19T11:03:07.504Z,59.0
2022-04-19T11:02:07.504Z,25.8
2022-04-19T11:01:07.504Z,46.3
2022-04-19T11:00:07.504Z,29.3
2022-04-19T10:59:07.504Z,88.4
2022-04-19T10:58:07.504Z,82.3
2022-04-19T10:57:07.504Z,51.1
2022-04-19T10:56:07.504Z,76.9
2022-04-19T10:55:07.504Z,15.5
2022-04-19T10:54:07.504Z,73.3
2022-04-19T10:53:07.504Z,43.4
2022-04-19T10:52:07.504Z,34.6
2022-04-19T10:51:07.504Z,60.3
2022-04-19T10:50:07.504Z,83.1
2022-04-19T10:49:07.504Z,67.8
2022-04-19T10:48:07.504Z,1.90
2022-04-19T10:47:07.504Z,26.7
2022-04-19T10:46:07.504Z,64.5
2022-04-19T10:45:07.504Z,77.7
2022-04-19T10:44:07.504Z,77.1
2022-04-19T10:43:07.504Z,22.6
2022-04-19T10:42:07.504Z,27.6
2022-04-19T10:41:07.504Z,55.7
2022-04-19T10:40:07.504Z,15.5
2022-04-19T10:39:07.504Z,92.8
2022-04-19T10:38:07.504Z,82.2
2022-04-19T10:37:07.504Z,50.4
2022-04-19T10:36:07.504Z,72.4

@mure
Copy link

mure commented Apr 19, 2022

Yep, the "Prepare time series" transform also fixes it.
I think this should still be an issue, though, because the behavior is extremely confusing. The graph should either handle "incorrectly" ordered data or throw some sort of error.

@leeoniya
Copy link
Contributor

leeoniya commented Apr 19, 2022

we do have some handling for this, but need to look into why it's not working here.

if (options.enforceSort) {
if (joinIndex >= 0) {
if (!isLikelyAscendingVector(frameCopy.fields[joinIndex].values)) {
frameCopy = sortDataFrame(frameCopy, joinIndex);
}
}
}

it looks like options.enforceSort is not set by default. the reason for this is isLikelyAscendingVector() must scan the entire dataset to be sure everything is sorted. this would impose a performance penalty for the 95% case. maybe we can make this assertion much cheaper and simply test just the first and last datapoints 🤔.

@cameronwaterman
Copy link
Contributor Author

maybe we can make this assertion much cheaper and simply test just the first and last datapoints 🤔.

Seems like an improvement over the current behavior at least. I would hope that we could give randomly sorted data as well, but it sounds like that would break interpolation. We could potentially take a decimated (or random) sample of the dataset and perform the comparison on those data points - this would help avoid the case where the first and last are sorted but intermediate points are not.

@leeoniya
Copy link
Contributor

the linked PR should cheaply handle when the first and last values indicate the set is not sorted ascending (e.g. reverse sorted).

I would hope that we could give randomly sorted data as well,

it's an edge case i think, since we have few issues that get opened about random data. in this scenario it's reasonable to expect a manual Sort by transform to be applied instead of incurring the cost of assertion for the 99.5% case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants