This documentation refers to the on-premises edition of MongoDB Charts. Read the Atlas service documentation to learn how to use MongoDB Charts with your Atlas project.

Setup MongoDB Charts and Load the Sample Data

Time to Complete: 8 minutes


  • To complete this tutorial you will need a MongoDB Atlas cluster. Refer to the Create a Cluster documentation for instructions on creating an Atlas cluster.
  • Whitelist the IP address from which you will be going through this tutorial in your Atlas project whitelist.

Load the Sample Data into Your Atlas Cluster

Atlas provides sample data you can load into your Atlas cluster. To load sample data into your cluster:


Log in to Atlas.

Log in to your Atlas account at


Load the sample dataset.

  1. Click the Ellipses (…) button for your cluster.
  2. Click Load Sample Dataset.

Atlas begins loading your sample data. This operation takes approximately 5 minutes to complete.

The following is a sample document from the Supply Store dataset:

  "_id": {
    "$oid": "5bd761dcae323e45a93ccfed"
  "saleDate": {
    "$date": {
      "$numberLong": "1441210319565"
  "items": [
      "name": "binder",
      "tags": [
      "price": {
        "$numberDecimal": "16.66"
      "quantity": {
        "$numberInt": "10"
  "storeLocation": "London",
  "customer": {
    "gender": "M",
    "age": {
      "$numberInt": "44"
    "email": "",
    "satisfaction": {
      "$numberInt": "2"
  "couponUsed": false,
  "purchaseMethod": "In store"

Add the Supply Store Collection as a Data Source

Once Atlas finishes loading the data, you can add the collection containing the sample data as a data source in Charts. Adding a collection as a data source links the collection to Charts and allows you to visualize that data.


Launch MongoDB Charts.

Click Charts in the left navigation pane in Atlas to launch MongoDB Charts. This launches an instance of MongoDB Charts linked to your Atlas project.


In MongoDB Charts, click the Data Sources tab.


In the Data Sources view, click New Data Source.


Select your Atlas project.

In the Connect to Deployment step of the modal, select the Atlas Project which contains the sample data.


Click Connect.


Select the sample supply store collections.

In the Choose Collections step of the dialog, select the sample_supplies database from the list. This selects the sales collection within the database.


Click Set Permissions.


Accept the default options and click Publish Data Source.


For details on data source permissions, see the Data Source Permissions page.

Next Steps

Now that you have established the data source in Charts, you can now Create a New Dashboard which will hold the visualizations.