Range Chart
Learn how to create a range chart in Semaphor
A range chart displays the variation between two data points over a period, highlighting the difference between minimum and maximum values. Ideal for visualizing ranges such as temperature fluctuations, price intervals, salary ranges, etc.
Simple Range Chart
You can display a simple range chart using the following query structure.
- The first column (categorical) is mapped to the
y-axis
. - The second column (categorical) is mapped to the
group
. - The third column (numerical) is mapped to the
from
value. - The fourth column (numerical) is mapped to the
to
value.
The group
column is used to display the legend.
Custom Range Chart
In certain cases, you might want to include a midpoint value within the range. For example, when displaying the minimum, mean, and maximum salary for a specific job role, you can achieve this by adding a thrid number column to the query, as shown below.
As you can see, even though you have provided the avg_profit
, the chart below currently displays only two values: min_profit
and max_profit
.
To include avg_profit
, you'll need to customize the chart by drawing a line at that specific value. You can achieve this by adding the below code snippet to the Custom Code
section of the visual.
In the Explorer view, click on the Gear Icon ⚙️ to open the customize dialog, paste the above code and apply changes.
Now, you can see the line drawn at avg_profit
, along with the updated tooltip displaying all three values. You can further customize the line style (e.g., dotted, dashed) by adjusting the code.
Split Range Chart
In some use cases, you might want to further split the ranges within by group. For example, you could break down the minimum, maximum, and average profit by ship mode
across different sub-categories
. You can structure your query like this:
The ship mode
column is used as a grouping column for the ranges.