Navigation
This documentation refers to the on premises version of MongoDB Charts. For documentation on the MongoDB Charts SaaS application in Atlas, click here.

Scatter Chart of Award-Nominated Movies with Their TomatoMeter Rating

Estimated Time to Complete: 5 minutes

Construct the Chart

Next, add a chart to your dashboard showing the TomatoMeter rating and MPAA rating of movies with the most award nominations. A scatter chart is a good choice for visualizing how data points cluster together around certain values and allows the representation of several different data dimensions.

1

Click Add Chart.

The Add Chart button is in the top right corner of the dashboard.

2

In the Data Source dropdown, select test.movieDetails.

3

Select the Chart Type.

  1. In the Chart Type dropdown, select Grid.
  2. Select the Scatter panel below the dropdown menu.
4

Add the desired fields to the proper encoding channels.

  1. In the Fields section, click the tomato field to expand the tomato object and view its properties.
  2. Drag the tomato.meter field to the X Axis encoding channel.
  3. In the Fields section click the awards field to expand the awards object and view its properties.
  4. Drag the awards.nominations field to the Y Axis encoding channel.
5

Add a query filter.

You can see now that higher-rated movies have a higher density of awards, but the chart is rather noisy. Add a query filter to exclude movies with zero awards and marginal MPAA ratings.

  1. In the Filters box, add the following query filter and click the Apply button:

    {"awards.nominations": {$gte: 1}, rated: {$in: ["G", "PG", "PG-13", "R"]}}
    
6

Differentiate the chart by MPAA rating.

  1. In the Fields section, click the rated field and drag it to the color encoding channel.

Additional Data Options

There are three options for adding more data to your chart. You can use any of your data fields to modify the size, color, and shape of the markers on the grid. The rated field works well here because it has low cardinality; there are only four possible values (G, PG, PG-13, and R). Fields with higher cardinality may make the chart too noisy to read.

7

Title your chart.

  1. Hover over your chart title above the center of the chart and click the pencil icon.

  2. Copy the following into the chart title input:

    Movies with Most Awards Nominations, by Rating
    
  3. Click the green check mark to save your title.

  4. Your chart should now look like this:

    Movies with the most awards by rating
  5. Click Save and Close to return to your dashboard.

Next Steps

Follow along to the next section of the tutorial to see how we can rearrange the charts on the dashboard.