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

Incorrect color scale when using a heatmap with log-scale #19393

Closed
Tracked by #45495
tomdug opened this issue Sep 25, 2019 · 4 comments
Closed
Tracked by #45495

Incorrect color scale when using a heatmap with log-scale #19393

tomdug opened this issue Sep 25, 2019 · 4 comments

Comments

@tomdug
Copy link

tomdug commented Sep 25, 2019

What happened:
Grafana incorrectly assigns color to buckets when using a logarithmic scale. The legend indicates a maximum value of 4, although the bucket contains 6 values and has a color that represents a value of 2. This seems to be related to the way 0s are handled when using a log scale.

Screenshot_20190925_101132

Also, this toggle does not seem to work
Screenshot_20190925_102053

How to reproduce it (as minimally and precisely as possible):
Here is demo of the bug:
https://snapshot.raintank.io/dashboard/snapshot/YfSMnwgvL4lEU1rDGjK61oTrjznIpeQE

To reproduce the issue, consider the following dataset with 7 values : [2, 1, 1, 0, 0, 0, 0] (with the same timestamp)

  • The linear scale splits the data in 3 buckets as you would expect: 0 (4 values), 1 (2 values), 2 (1 value) and the legend goes from 0 to 4 (maximum).

  • The log scale splits the data in 2 buckets, one for 0s and 1s (6 values) and one for 2 (1 value). However the color seems to indicate a value of 2 for the first bucket instead of 6

-> The bucket with 0s and 1s contains 6 values, has a color that indicates 2, and a legend with a maximum value of 4

Possible explaination: It seems that under the hood, 0s are put into a special bucket (see here)
that is merged with the bucket with 1s when displayed. However, this special bucket is still taken into account for the computation of the color scale (that is why the maximum is 4) but only 1s are considered when computing the color of the bucket (2)

Environment:

  • Grafana version: 3.6.5
  • Data source type & version: TestData Db
  • OS Grafana is installed on: Grafana cloud
  • User OS & Browser: Ubuntu 18.10, Chrome
  • Grafana plugins: -
@marefr
Copy link
Member

marefr commented Sep 25, 2019

@tomdug Can you show me how you have configured grafana testdata query in your panel? Trying to reproduce this on current master, but don't get the same result as you.

@marefr marefr added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Sep 25, 2019
@tomdug
Copy link
Author

tomdug commented Sep 25, 2019

Screenshot_20190925_125717
Screenshot_20190925_125753

@marefr marefr added area/panel/heatmap help wanted type/bug and removed needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc labels Sep 25, 2019
@marefr
Copy link
Member

marefr commented Sep 25, 2019

Confirmed bug on master (c60882b)

@leeoniya
Copy link
Contributor

leeoniya commented Jun 4, 2022

this should be fixed in the new heatmap panel. the color scale is not related to the linear or log bucket (the y axis/scale), but to the count/value within the buckets.

@leeoniya leeoniya closed this as completed Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants