Chart Type - Gauge Chart


Here's a Parameterized Snippet to transform data to make a stacked bar chart that simulates the look and feel of a gauge chart.
Base: Number Overlay
Series Settings:
- Value = Scatter
- Top = Bar (Green optional: #00ff00)
- Middle = Bar (Yellow optional: #ffff00)
- Red = Bar (Red optional: #ff0000)
Name: gauge_chart(table,name,value_field,lower_bound,middle_bound,upper_bound)
select
*
from
(
select
'[name]' as x
, 'Lower' as bound
, [lower_bound] as y
union
select
'[name]' as x
, 'Middle'
, [middle_bound] - [lower_bound]
union
select
'[name]' as x
, 'Top'
, [upper_bound] - [middle_bound]
union
select
'[name]' as x
, 'Value'
, [value_field] as y
from
[table]
)
as t
order by
case
when bound = 'Value'
then 1
when bound = 'Top'
then 2
when bound = 'Middle'
then 3
when bound = 'Lower'
then 4
end
Fun fact, from the Stack Exchange post:
It has recently stepped even further away from its origins by being borrowed for a computer display that shows useful real-time data such as the time, weather, news headlines, stock prices and phone numbers. It’s a long way from horse-drawn carriages on muddy roads.
Updated 03-02-2023
intapiuser
Admin
Joined December 15, 2022