Here, we will review how to encode numeric variables when designing charts. Numeric variables are simply numerical data that can be measured, counted, or quantified. Encoding is the process of translating this data into visuals that are easy to understand.
To make the most effective and engaging charts, we can use six key encoding techniques:
Position: Positioning numeric variables on our charts is one of the most common and effective ways to encode them. For instance, vertical and horizontal bar charts use position to represent data. In these charts, the length of the bars displays the values, while the position of the bars along the axis shows the categories. For example, the number of cars sold in different months or the annual rainfall in different cities.
Length or Size: Another way to encode numeric variables is by using the length or size of visual elements on your chart. Column, bar, and bubble charts are examples of visualizations that use size to represent values. For instance, a bubble chart can visually represent a company’s sales by the size of the bubbles to indicate profits and their position on the chart to show geographic location.
Color: Color often encodes numeric variables by assigning different colors to distinct values. This can be done using a color gradient scale, where lighter colors represent lower values, and darker colors represent higher values. For example, a heatmap chart uses colors to represent various data points, like website traffic density in different areas of a web page.
Shape: Shapes can also be used to represent numeric variables. Modifying the shapes of data points can convey additional meaning. For instance, in a scatterplot, various shapes of data points can represent different categories or groups within the data, while the position of the shapes on the chart can show the relationship between two numeric variables.
Area: Using area to encode numeric data is common in area charts or treemaps. Here, the size of the areas represents the values associated with each category. For example, a treemap chart can show the market shares of different industries, where the size of the boxes corresponds to each industry’s size, and the nested boxes inside represent the market shares of individual companies.
Angle or Slope: Angle and slope can also be used to encode numeric variables, as seen in pie charts or line charts. In pie charts, the angle of each slice represents the proportion of the whole for a category. On the other hand, line charts use slopes to show the difference in values across a period. For instance, a line chart depicting climate change would show the slope of the earth’s rising annual temperature over time.