▾
Weather stations styled with visual variables to display wind speed, direction, and air temperature.
What is multivariate data visualization?
Multivariate data visualization involves visualizing more than one data value in a single renderer. This is done for many reasons, including to:
- View the relationship between two or more variables
- Compare or contrast the difference between two variables
- View spatial patterns that may not be related among several variables at one time.
How multivariate data visualizations work
Multivariate visualizations can be done by adding more than one visual variable to a simple renderer. Common combinations include the following:
- Color and size
- Size and rotation
- Size, rotation, and color
You can create multivariate visualizations using many other combinations of visual variables as well, including opacity.
Examples
Color and size
Color and size are typically used to show the relationship between two variables or to show a rate with a color variable, and the magnitude of a variable using a size variable.
20 collapsed lines
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate - color and size</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script>
<style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map item-id="91f6ef52bd524ace99eed8de99ea0123"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="top-right"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>2 collapsed lines
</body></html>- Color visualizes relative humidity.
- Size visualizes the difference between heat index and measured air temperature.
43 collapsed lines
<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate - color and size</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script> <style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map center="-96.981724, 38.51482" scale="36978595"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="top-right"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>
<script type="module"> const [Map, FeatureLayer] = await $arcgis.import(["@arcgis/core/Map.js", "@arcgis/core/layers/FeatureLayer.js"]);
const viewElement = document.querySelector("arcgis-map");
const renderer = { type: "simple", symbol: { type: "simple-marker", style: "circle", color: [50, 50, 50], outline: { color: [255, 255, 255, 0.5], width: 0.5, }, size: "8px", }, visualVariables: [ { type: "size", valueExpression: "$feature.HEAT_INDEX - $feature.TEMP", valueExpressionTitle: 'Difference between "feels like" and air temperature', minDataValue: 0, maxDataValue: 30, minSize: 4, maxSize: 24, }, { type: "color", field: "R_HUMIDITY", stops: [ { value: 20, color: "#fffcd4" }, { value: 35, color: "#e7ae9d" }, { value: 50, color: "#ce6065" }, { value: 65, color: "#88314f" }, { value: 80, color: "#420239" }, ], }, ],27 collapsed lines
};
// Set the renderer on the feature layer const layer = new FeatureLayer({ portalItem: { id: "cb1886ff0a9d4156ba4d2fadd7e8a139", }, title: "Current weather conditions", renderer: renderer, });
const map = new Map({ basemap: { portalItem: { id: "ba223f982a3c4a0ea8c9953346e2a201", }, }, layers: [layer], });
viewElement.map = map; viewElement.constraints = { snapToZoom: false, }; </script> </body></html>Size and rotation
Size variables are good for visualization total counts or magnitudes. Rotation and size are commonly paired together to map weather data, such as wind. Rotation indicates the direction of flow, while size indicates the wind speed.
20 collapsed lines
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate - size and rotation</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script>
<style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map item-id="8a0f6c016aed44d798a1c9501e7cb714"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="top-right"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>2 collapsed lines
</body></html>39 collapsed lines
<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate - size and rotation</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script> <style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map center="-95.597702, 39.83486" scale="36978595"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="top-right"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>
<script type="module"> const [Map, FeatureLayer] = await $arcgis.import(["@arcgis/core/Map.js", "@arcgis/core/layers/FeatureLayer.js"]);
const viewElement = document.querySelector("arcgis-map");
const renderer = { type: "simple", referenceScale: 36978595, symbol: { type: "web-style", styleUrl: "https://www.arcgis.com/sharing/rest/content/items/eef578633a3e41b985d0c980275c6d74/data", name: "Arrowhead B_Arrowheads_3", }, visualVariables: [ { type: "size", field: "WIND_SPEED", minDataValue: 5, maxDataValue: 60, minSize: "4px", maxSize: "24px", }, { type: "rotation", valueExpression: "$feature.WIND_DIRECT + 90", rotationType: "geographic", }, ],25 collapsed lines
};
// Set the renderer on the feature layer const layer = new FeatureLayer({ portalItem: { id: "cb1886ff0a9d4156ba4d2fadd7e8a139", }, title: "Current weather conditions", renderer: renderer, });
const map = new Map({ basemap: { portalItem: { id: "ba223f982a3c4a0ea8c9953346e2a201", }, }, layers: [layer], });
viewElement.map = map; viewElement.constraints = { snapToZoom: false }; </script> </body></html>Size, rotation, and color
Use three visual variables only when they clarify related patterns without overloading the map.
20 collapsed lines
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate - size, rotation, and color</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script>
<style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map item-id="f0783faf4273478a8d164821fa12e291"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="bottom-left"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>2 collapsed lines
</body></html>- Size represents wind speed.
- Rotation represents wind direction.
- Color represents air temperature.
46 collapsed lines
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Multivariate data visualization | Sample | ArcGIS Maps SDK for JavaScript</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.2/"></script>
<style> html, body { height: 100%; margin: 0; } </style> </head>
<body> <arcgis-map center="-98.036293, 38.671835" item-id="ba223f982a3c4a0ea8c9953346e2a201"> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-expand slot="bottom-left"> <arcgis-legend></arcgis-legend> </arcgis-expand> </arcgis-map>
<script type="module"> const FeatureLayer = await $arcgis.import("@arcgis/core/layers/FeatureLayer.js");
const referenceScale = 9244650;
const viewElement = document.querySelector("arcgis-map"); await viewElement.viewOnReady();
// Renders each weather station with three visual variables: // Rotation - indicates wind direction // Color - indicates air temperature // Size - indicates wind speed const renderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "web-style", styleUrl: "https://www.arcgis.com/sharing/rest/content/items/eef578633a3e41b985d0c980275c6d74/data", name: "Arrowhead B_Arrowheads_3", }, visualVariables: [ { type: "rotation", valueExpression: "$feature.WIND_DIRECT + 90", rotationType: "geographic", }, { type: "size", field: "WIND_SPEED", minDataValue: 0, maxDataValue: 60, minSize: { type: "size", valueExpression: "$view.scale", // adjust the min size by scale stops: [ { value: referenceScale, size: 8 }, { value: referenceScale * 2, size: 6 }, { value: referenceScale * 4, size: 4 }, { value: referenceScale * 8, size: 2 }, ], }, maxSize: { type: "size", valueExpression: "$view.scale", // adjust the max size by scale stops: [ { value: referenceScale, size: 20 }, { value: referenceScale * 2, size: 15 }, { value: referenceScale * 4, size: 10 }, { value: referenceScale * 8, size: 5 }, ], }, },28 collapsed lines
{ type: "color", field: "TEMP", stops: [ { value: 20, color: "#2b83ba" }, { value: 35, color: "#abdda4" }, { value: 50, color: "#ffffbf" }, { value: 65, color: "#fdae61" }, { value: 80, color: "#d7191c" }, ], }, ], };
// Set the renderer on the feature layer const layer = new FeatureLayer({ definitionExpression: "TEMP IS NOT NULL", portalItem: { id: "cb1886ff0a9d4156ba4d2fadd7e8a139" }, title: "Current weather conditions", renderer, });
viewElement.map.add(layer);
viewElement.scale = referenceScale * 4; </script> </body></html>Best practices
Using more than one visual variable adds complexity to the visualization. This makes it more difficult for the end user to understand the message. You should always carefully consider whether using multiple variables in one view is preferable to displaying separate views of the data.
Other multivariate styles
You don’t need visual variables to create multivariate visualizations. The following guide pages demonstrate how to create multivariate visualizations with other renderer types.
Predominance
A predominance visualization colors features based on the predominant value among a set of competing or similar numeric attributes.
Dot density
Learn how to use dot density to measure the density of a numeric attribute or set of comparable variables.
Charts
Learn how to use charts to visualize the distribution of multiple numeric variables in a layer.
Relationship
Learn how to use a relationship renderer to explore the relationship between two numeric data attributes.
Related samples and resources
Create a custom visualization using Arcade
Thematic multivariate visualization (3D)
Thematic visualization with realistic 3D symbols
Scale feature sizes based on real world sizes (2D)
Clustering with visual variables
API support
| 2D | 3D | Arcade | Points | Lines | Polygons | Mesh | |
|---|---|---|---|---|---|---|---|
| | | | | | | | |
| | | | | | | | |
| | | | | | | ||
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | |
- Color only
- Size variable creators only supported for points
- Size variable creators not supported in 3D