Docs Menu

Docs HomeView & Analyze DataAtlas Charts

Column Chart Showing Total Sales by Store Location

Time to Complete: 5 minutes

Looking at the data fields available in the schema, some of the most valuable information you can relay revolves around revenue. You may want to know how various stores are performing, specifically if there are any stores significantly under or overperforming compared to others.

A column chart works well for this type of visualization because you can easily compare individual store revenue based on the size of each column.

1
2

In the Select Data Source modal that appears:

  1. Click the Project tab.

  2. Click the name of the deployment that contains the sample data source.

  3. Click the sample_supplies database. The database's data sources appear.

  1. Click Select on the sales data source.

3

In the Chart Type dropdown, select Stacked Column.

To render a stacked column chart, Atlas Charts creates a bar or column for each distinct value in the category encoding channel field.

4
  1. Drag the storeLocation property from the Fields section of the Chart Builder view to the X Axis encoding channel.

    This tells Atlas Charts to create a column for each storeLocation value in the dataset.

    Note

    Atlas Charts infers the data type of each field and provides symbols to easily determine these data types when building your chart. These symbols can help ensure your chart renders as expected by using proper data types for each encoding channel. For example, the calendar icon next to the saleDate field signifies that this field is a timestamp.

  2. In the Fields section click the items field to expand the items object and view its properties.

  3. Drag the items.price field to the Y Axis encoding channel.

    This tells Atlas Charts to use the items.price field for the chart's aggregation.

  4. In the items dropdown below Array Reductions, select Unwind array.

    Array reductions dictate how to process an array so its elements can be visualized. The unwind array option creates a new document for each element in the array, so each item's price is added to the total for that store.

  5. In the Aggregate dropdown, select sum.

    The $sum aggregation operator adds the prices of all items per store together to display the chart.

5
  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:

    Total Sales ($) by Store Location
  3. Click the check mark to save your title.

    Your chart should now look something like this:

    Stacked Bar Chart Builder
    click to enlarge

    Notice that the stores generating the most revenue are the Denver and Seattle locations.

6

You will be navigated back to your Super Supply Store Orders dashboard and it should look something like this:

Order Tutorial Dashboard Stage 1
click to enlarge

Now that we have a visualization showing a high-level overview of store revenue, one might wonder which type of item each store is selling the most of. The following section of the tutorial illustrates how to build a donut chart to analyze the tag names of items being sold.

←  Create a New DashboardDonut Chart Showing Most Common Tags for Items Sold →