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

graph: show "significant figures" instead of decimal places #8621

Closed
matthiasr opened this issue Jun 15, 2017 · 3 comments
Closed

graph: show "significant figures" instead of decimal places #8621

matthiasr opened this issue Jun 15, 2017 · 3 comments
Labels

Comments

@matthiasr
Copy link

  • What Grafana version are you using?
    4.3.2

  • What datasource are you using?
    Prometheus

  • What OS are you running grafana on?
    Linux

  • What did you do?
    Created a single-stat with € unit, specified "2 decimals" precision

  • What was the expected result?
    €1.2K or €1200, €460

  • What happened instead?
    €1.23K, €456.78

The shortening of the value (1K instead of 1000) makes this even more confusing, but as a feature I would also like this for un-shortened numbers. Sometimes a number is known not to be exact and I'd rather only display a certain number of significant figures. Currently, I can only specify "decimals" (right of the point) while significant figures might already end left of the point.

For shortened units this is even worse because the precision implied varies wildly (plus/minus 3 figures).

This could either replace the Decimals or be an additional option.

@daniellee daniellee changed the title [Feature request] "significant figures" instead of decimals graph: show "significant figures" instead of decimal places Nov 9, 2020
@marcelgsteiger
Copy link

marcelgsteiger commented Aug 25, 2021

This or a similar feature is especially helpful for displaying counters, e.g. energy counters.

One thing that could perhaps be done easily, is prohibiting the automatic conversion of units to K, M, G... some way. To begin, one could stop the conversion as soon as zero decimal places have been specified. For example:
if I specify Watt as units with 0 decimal places, 1100 W will remain this way and never convert to 1 kW; whereas if I specify one decimal place, it will be displayed as it does currently (as 1.1 kW) .

This way we could alleviate the problem without introducing a completely new feature.

Zabbix (which I use as a backend to grafana) has the following solution to this problem: It allows to specify the unit with a modifier. Example: If I define the unit as dWh (deciwatthours), it will convert to Wh, kWh, MWh etc. as usual. However, if I prepend the unit with an exclamation mark ( !dWh ) it will always be shown as dWh. For energy counters, this is very helpful: I have energy counters with a 1 dWh resolution and want to display the exact value. In a diagram with a counter starting at about 1.75 MWh on the y-axis it looks like this:

grafik

Sorry, some numbers are cut off from the graphic, but the idea can be seen. Zabbix is less than perfect in rendering graphic, this is why I prefer Grafana...

#38493 was my original post about this. It would be nice if we could do something like this in grafana, too. So I add my suggestion here.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale Issue with no recent activity label Jan 19, 2024
Copy link
Contributor

This issue has been automatically closed because it has not had any further activity in the last 30 days. Thank you for your contributions!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants