Configure a Gauge Chart SQL Template
The Gauge chart template query must provide two values. The first value is the actual data point - the value appearing between the minimum and maximum, where the minimum value is always zero. The second value is the maximum value. For percentage-based Gauge charts, the second value must be 100.
A Gauge chart is considered a percentage-based chart if the format pattern of the first value ends in a percentage, or the formatter is Gauge.
The default colors of a Gauge chart are green starting at zero, yellow at 10% of the maximum value, and red at 90%. If the chart is not percentage based, the values provided by the query are used as is. For example, if the query is as follows:
select 50, 250 from apt_v_dual
The resulting chart appears as below using the default color palette.
If the formatter selected for the first field is Gauge, then optional format pattern can be provided to define the color ranges. These are referred to as color stops. Two or three color stops can be specified. If no format pattern or an invalid pattern is specified, the default color stops are used.
In this scenario, red starts at zero, yellow starts at 20%, and green starts at 80%.
Example-1: 20:80::red:yellow:green
Example-2: 20:80::#DF5353:#DDDF0D:#55BF3B