Overview
Gauge chart displays a single numeric value and its relation to a set of value ranges with an associated color. An example can be a KPI metric that has a "good", "warning" and "bad" ranges - the Gauge would show the value and its position between the minimum and maximum and highlighted with a color that corresponds to the range the value currently falls in.
Chart modes
There are 2 modes that determine how the Gauge ranges are defined:
1. Manual - The SQL query, in this case, produces a single value, the ranges and their corresponding colors are hard-coded in the report. This is useful in case the range definitions are static and always have the same values.
2. From query - The SQL query produces 1 row of numbers, where the first column is the current value and the following columns define the values for the ranges. The report configuration then allows to define the color for each of the ranges, but the range spans can dynamically change over time based on values in your database.
Data Requirements
For the "Manual" mode, the gauge chart needs 1 row and 1 column with a numerical value in the results.
For the "From query" mode, the gauge chart needs a single row with numerical values in the results. The first column contains the current value and the subsequent columns contain the ranges. The ranges values would be ideally sorted from smallest to largest and the min/max values for each range should not be duplicated. I.e a SELECT 42, 0, 50, 75, 100
would display the current value 42 against ranges 0-50, 50-75, 75-100.
Example queries:
Manual:
-- Get avg response time for support tickets
SELECT avg(response_time) FROM support_tickets;
-- Get current speed of a vehicle:
SELECT current_speed FROM vehicles WHERE {vehicle_id=selected_vehicle};
From query:
-- Display current speed against the max speed for the vehicle type:
SELECT current_speed, 0, max_speed * 0.75, max_speed * 0.9, max_speed
FROM vehicles WHERE {vehicle_id=selected_vehicle};
Core Options
Gauge ranges: Choose between the manual definition of ranges and definition from query results. The "From query" option is only available if there are 3 or more columns - current value + at least one min/max range.
Add range: In the manual mode allows adding an additional range definition.
Color: Define a color that corresponds to the range - choose one of the current scheme colors or a manual color.
Min / Max values: In the manual mode allows adjusting the range minimum and maximum. In "From query" mode the values are not editable and only displayed as the current ranges to define which color would correspond to that range.
Visual Options
240° / 140°: 2 different visual styles for the gauge
Value label: Turn on or off the current value label in the middle of the gauge
Axis labels: Turn on or off the values outside of the gauge ring
S/M/L/XL: Font size for the labels outside of the gauge ring.