数字图表显示数据字段的单个聚合值。
数字图表编码渠道
数字Atlas Charts只需要一个编码渠道,称为Number 。这是一个aggregation编码渠道,根据所选的字段和聚合方法进行聚合,并在图表中显示结果。
用例
数字图表可用于突出显示表示数据总体状态的总计或值。 例如,商店可以使用数字图表来表示所有销售的总美元价值。 此外,连锁酒店可以使用数字图表来表示所有酒店的平均空置房间数,或应用筛选器来查看所选地区的空置房间总数。
自定义选项
条件格式
您可以使用条件格式规则设置图表显示数字的样式。 这些规则是动态应用的:如果您的号码发生变化以匹配或停止匹配您定义的条件,其样式也会更新。
要了解如何使用条件格式化规则,请参阅条件格式化自定义选项。
示例
商店销售总值
下图是一家模拟办公用品商店销售数据的可视化呈现。 集合中的每个文档代表一次单独的销售,其中包含有关所售商品和购买者的信息。 此数字图表显示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.
锻炼期间消耗的最大卡路里
下图是锻炼数据的可视化呈现。 collection中的每个文档代表一项锻炼活动,其中包含有关所执行的活动类型和锻炼期间消耗的卡路里量的信息。此数字图表显示了所有swimming和surfing锻炼中消耗的最大卡路里:

The Number field of Calories Burned (kCal) tells Atlas Charts to aggregate the field based on the selected method of $max.
我们已对此图表应用筛选器,以将 Atlas Charts 检查的文档限制为仅具有Activity Type为Surf 、 Swim或Indoor Swim的文档。 Atlas Charts 确定符合此条件的所有文档中Calories Burned (kCal)字段的最大值,并在可视化中显示该值。
限制
数字图表的最大查询响应大小为 5000 个文档。