Display labels instead of raw data in Charts


I would like to know if it possible to display custom labels instead of raw data in a Charts.
For exemple I have a collection like this
Item_Id [1, 2, 3]
Amount [10, 3, 21]
Currency [EUR, USD, EUR]

And from that I display a table
But even if I only have the item_id in the collection, I know what are the name of the item. The labelling of the item is manage by the application, not in the database.

So in the table in MongoDB Charts I woul like to be able the display the Labels instead of the Item_id because the users of the Charts does not know the correspondance between the id and the label.
I can not do an agregation because the data set with the id/label correspondance is not accessible by MongoDB charts.

How can I do that ?

Thanks for the help

Hi @Sylvain_Gelfi -

If the ID-to-label mapping doesn’t exist in the database, you’ll need to duplicate this logic - it’s not clear how many items you have so I don’t know how difficult to manage this may be.

But you can do this in Charts - I would suggest using the binning feature on a string field (if your ID is not a string, you will need to convert it first). Alternatively you could use a calculated field that uses the $switch operator.