Number Chart
Number charts display a single aggregated value from a data field.
Number Chart Encoding Channels
Number charts only require a single encoding channel, called Number. This is an aggregation encoding channel which aggregates based on the field and aggregation method chosen, and displays the result in the chart.
Use Cases
Number charts are useful for highlighting grand totals or values which represent the overall state of your data. For example, a store may use a number chart to represent the total dollar value of all sales. Additionally, a hotel chain may use a number chart to represent the average number of vacant rooms across all hotels, or apply a filter to see the total number of vacant rooms in a select region.
Customization Options
Conditional Formatting
You can style the number that your chart displays with conditional formatting rules. These rules are applied dynamically: if your number changes to match or stop matching a condition you define, its styling updates.
To learn how to use conditional formatting rules, see the Conditional Formatting customization option.
Examples
Total Value of Store Sales
The following chart visualizes sales data from a mock office supply store. Each document in the collection represents an individual sale, which contains information on the item(s) sold and the purchaser. This number chart shows the total sum of all sales stored in the collection:
The Number field of items.price
tells Atlas Charts to
aggregate the field based on the selected method of
$sum. Since
items
is an array, we have to select an array reduction option
before we can aggregate. In this example, we choose
Unwind Array, which creates a new document for each
element in the items
array. Atlas Charts sums the price
of each
newly created document and displays the value in the visualization.
Maximum Calories Burned During Workouts
The following chart visualizes workout data. Each document in the
collection represents an individual workout activity, which contains
information on the type of activity performed and the amount of
calories burned during the workout. This number chart shows the
maximum calories burned across all swimming
and surfing
workouts:
The Number field of Calories Burned (kCal)
tells
Atlas Charts to aggregate the field based on the selected method of
$max.
We have applied a filter to this chart
to restrict the documents Atlas Charts examines to only those with an
Activity Type
of Surf
, Swim
, or Indoor Swim
. Atlas Charts
determines the maximum value of the Calories Burned (kCal)
field
across all documents which match this criteria and displays the value
in the visualization.
Limitations
The maximum query response size for a number chart is 5000 documents.