Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 SlamData 对存储在 MongoDB 中的数据进行建模。每个对象看起来像这样:
{ //... other fields rating: 3 //... other fields }
当我尝试构建图表时,我选择“评级”作为类别,但似乎我没有选择简单地计算评级数量。
我正在寻找一个包含 5 个条形图的图表(评级为 1-5)。对于每个条,我想显示具有该评级的对象的数量。
在构建条形图时,在 SlamData 内部,您需要提供一个可用于类别的字段和一个可用于度量的字段。我会做的事情如下:
添加查询卡,查询类似于以下内容:
select count(*) as cnt , rating from `/mount/database/collection` group by rating
添加设置图表卡并选择包含以下信息的条形图:
类别:评级 测量:cnt
添加显示图表卡
那应该给你你需要的东西。