Scatter charts plot data with individual data points placed along the X and Y axes. Optionally, the data point representations may use shapes and colors to display additional data dimensions.
Scatter Chart Encoding Channels¶
Scatter charts provide the following encoding channels:
X / Y Axis
The X and Y axis encoding channels accept numerical and date fields and display the range of values from the field along the corresponding axis.
(Optional) An aggregation encoding channel that changes the size of the data point markers, with larger sizes indicating larger aggregated values.
(Optional) A category encoding channel that changes the color of the data point markers to indicate a corresponding data value. MongoDB Charts lists the colors used in a key to the right of the chart.
(Optional) A category encoding channel that changes the shape of the data point markers to indicate a corresponding data value. MongoDB Charts lists the shapes used in a key to the right of the chart.
Scatter charts are useful for representing numerical data and showing clearly how data points cluster together in certain areas. The Size, Color, and Shape encoding channels allow you to reveal additional trends for data dimensions with low cardinality.
Scatter charts show an individual marker for each data point, so they work better with smaller result sets. Outliers and extreme data points are easy to identify.
Consider using a scatter chart to display:
- Temperature data for selected cities
- Volume of sales data for selected retail outlets
- Population density figures across several countries
The following scatter chart uses a database of information about AirBnB rental properties in Sydney, Australia. The X axis shows the review ratings given to individual properties, with the price per night displayed along the Y axis. The query filter restricts the result set to properties with at least 100 reviews.
The chart shows that lower-priced properties have a wider range of review scores, while higher-priced properties have a smaller score range with generally higher scores.
Movies with the Most Award Nominations¶
The following more complex scatter chart uses a database with movie data compiled from IMDb and Rotten Tomatoes. The chart shows the TomatoMeter rating (ranging from 0 to 100) of movies with at least one award nomination. Each data point marker represents one movie. The X axis shows the movie's TomatoMeter rating and the Y axis shows the number of award nominations the movie received.
The query filter restricts the result set to exclude marginal data points.
The chart uses the Color and Shape encoding channels to shed further light on the types of movies which receive the most award nominations. The color of each data point shows the MPAA (Motion Picture Association of America) rating the movie received. The chart uses the Shape encoding channel to indicate the year in which the movie was released, and bins the data to place each movie into a time range, with each bin covering 25 years. Without the bins, there would be a different shape for every year, which would make the chart too noisy to read.