grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
61.74k stars 11.77k forks source link

Request for Logarithmic Scale Option for Bar Gauge #82079

Open 1090MHz opened 5 months ago

1090MHz commented 5 months ago

Description: I would like to request the inclusion of a logarithmic scale option for bar graphs in Grafana. Currently, Grafana provides a logarithmic scale option for line graphs, but not for bar graphs. Having the ability to use a logarithmic scale for bar graphs would be beneficial in scenarios where the data spans a wide range of values and a logarithmic scale would provide a more accurate representation.

Use Case:

Visualizing data with a large range of values, such as network traffic, latency, or storage.
Comparing data points with significant differences in magnitude.
Highlighting smaller values that might be overshadowed in a linear scale.

Expected Behaviour: When selecting the logarithmic scale option for a bar graph, the Y-axis scale (or X-axis if plotted horizontally) should be adjusted accordingly, allowing for a logarithmic representation of the data. This would enhance the flexibility and usefulness of bar graphs in Grafana.

Thank you for considering this feature request. I believe that adding a logarithmic scale option for bar graphs would greatly enhance the capabilities of Grafana and provide users with more flexibility in visualizing their data.

leeoniya commented 5 months ago

generally this is not recommended, but we'll consider it.

https://www.graphpad.com/support/faq/graph-tip-dont-use-a-log-scale-on-a-bar-graph/

1090MHz commented 5 months ago

Another use case is for monitoring UHV pressure which can vary by many orders of magnitude. Using the math operator this panel shows the exponent, but the variable names in the legend end up with an extra letter "B" which is from the expression log($A)/log(10): image

systemcrash commented 3 months ago

It seemed intuitive to look for logarithmic since the older bar gauge with angular based graphs.

No big deal. Just feels weird having to migrate and not having logarithmic for those dashes built using it.

1090MHz commented 3 months ago

Using Regex replacement it is possible to fix the variable names in the legend so I am using this work around for now. For plotting scientific data which can vary by many orders of magnitude not having this feature built into Grafana is annoying.

systemcrash commented 3 months ago

Maybe we should learn these rules of data visualisation :) https://www.graphpad.com/support/faq/graph-tip-dont-use-a-log-scale-on-a-bar-graph/

In my case, I capture data that has huge ranges, with some values low in the 10-100, and other values in the millions so it really makes sense to have the option to use logarithmic, so that all data gets seen.

It's one of those cases where, counter to the above article "Using a logarithmic axes on a bar graph rarely make sense." it actually makes sense.

For @1090MHz I imagine dB values which are generally measured logarithmically, where +3dB is typically a 200% increase, only log scale makes sense.

1090MHz commented 3 months ago

The request is for a logarithmic scale option for a bar gauge not a bar graph.

leeoniya commented 3 months ago

a reasonable compromise might be to show a log axis.

it should be obvious that a bar that is twice as long represents a value that is maybe 16x larger. the same reason you would never draw a log line chart without a y axis. the scale should be visible/labeled if it is non-linear.

image