How i can show percentage on gauge chart

I have a column in data which contain 1000 row and values are 0 and 1 , how i can calculate percentage and show on gauge. for example 750 rows have 1 than percentage is 75

Hi @akshay_bhardwaj ,

I think you can use Lens formula for this use case:

sum(my_field) / count()

and set the data format to percentage.

but there is no percentile aggregation method in gauge.
can we do it with advance json input?

What version of the stack are you using?
The one you've opened is the Aggregation based editor, while formula is available in the Lens editor.

But in lens editor above gauge(circle) is not present.

You are correct, there are no half circle gauges in Lens, only vertical and horizontal ones.

If you really need semi-circle gauges, the only solution I can think of it TSVB:

  • Select the Gauge visualization
  • Configure a Count aggregation, then add a new aggregation
  • Configure a Sum aggregation, then add a new aggregation
  • Configure a Math aggregation, then configure two variables: count for the Count metric, and sum_metric for the Sum metric
    • Type params.sum_metric / count in the Math text field.
  • In the Options panel ( on top of the panel, next to Metrics) pick the Percentage formatter

Thanks Marco can you please me more to add percentage sign % after value and round up decimal values

As described in the last step above, if you choose the Percent formatter will add the % on its own.

Thanks Marco for you quick response.....

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.