Style By Value

Styling Guides

Style By Value

This guide describes how to make a bivariate map using graduated symbol size and color, by using the BY VALUE option. This feature requires a map layer containing any geometry type that contains numeric and categorical data columns.

When styling BY VALUE, it is important to understand the data type of your dataset columns. When you upload your data to CARTO, it automatically assigns a data type to your columns; such as string, number, date, or boolean. Certain styling is rendered based on the column data type. This is especially useful since you can filter and style map layers by column values in CARTO Builder.

Example of selecting column values from style tab

If you are unsure about the column data types for the connected dataset, view the Data View of your map layer. The Data View and Map View appear as icons on your map visualization when a map layer is selected. Click to switch between viewing your connected dataset as a table, or show the map view of your data.

Graduated and Proportional Maps

While you can use any map to style by value, for this guide we will use a graduated and proportional symbol map, which are a class of maps that visually use size to represent a discrete variable in a dataset. The result is a map where larger symbols indicate higher values, and smaller ones indicate lower values.

The two methods used are absolute scaling and range-grading. With absolute scaling, the area of each symbol on the map is scaled proportionately to its value in the data (proportional symbol maps). Range-grading breaks down values into ranges, using a classification method where symbols are sized based on the range they fall into (graduated symbol maps).

CARTO Builder supports range-grading within the styling options, which can be used with numeric fields.

Create a Graduated Symbol Map

  1. Click on "Download resources" from this guide to download the world_population_by_continent.geojson file.

  2. From Your datasets dashboard, import the dataset to your account.

  3. Click the CREATE MAP button from the dataset. Builder opens displaying point data.

  4. Change the basemap to CARTO WORLD ANTIQUE.

  5. Click on the world_population_by_continent map layer.

    The STYLE tab opens, displaying no aggregations by default.

    The following style aggregation methods are available for map layers containing point geometries.
  6. Edit the SIZE/COLOR, STROKE, and BLENDING options to see how the points change on the Map View.

Graduated symbol map

For this guide, we will symbolize the points in two ways:

  • Apply a numeric attribute for the size of the symbol.
  • Apply a categorical data column for its color.

Style by Value for Symbol Size

To visualize the population of different countries by varying sized symbols, style the marker SIZE by the population value for the countries.

  1. From the STYLE tab of the map layer, click the SIZE value to open the size properties for the map layer. The FIXED tab opens by default.

  2. Click BY VALUE to select the pop_2015 as the value for the classification.

  3. Change the classification method:

    • Select Jenks as the classification method.

    • Keep 5 buckets for the number of data ranges to group the data.

  4. For the size of the marker, enter 5 as the MIN value and 35 as the MAX value, which clearly symbolizes the range of population for the countries in our map.

As a best practice, you should understand the data that you are working with before applying a classification method. Maps can often be misleading if the methods used do not reflect the underlying pattern of the data.

GSize by value

Style by Color for Categories

To visually group the population symbols by continents, style the COLOR by the continent category for each country.

  1. Click the COLOR to open the color properties for the map layer. The SOLID tab opens by default.

  2. Click BY VALUE to select the continent_name category column.

    The default colors assigned to the six unique categories appears.

    Color by value

Try adding some widgets and change the colors of the various categories (click on the color scheme for each category and select a custom color), or switch to the CartoCSS view of the STYLE tab and apply a TurboCARTO ramp (which applies map styling using a single line of code).

Change category colors

Other Resources