I need to reverse the order of stack in mongodb altas chart - Stacked Column

Below is the screenshot of chart, as you see on hover Current spend needs to at the bottom but it’s on Top.

Bellow is aggregation that I’m using.

[
  {
    $unwind: "$tieredReduction.formattedDetails"
  },
  {
    $project: {
      facility: 1,
      vendor: 1,
      productCategory: 1,
      contractExpiryDate: 1,
      contractEffectiveDate: 1,
      contractId: 1,
      priceReductionTierLabel:
        "$tieredReduction.formattedDetails.priceReductionTierLabel",
      priceReductionTierAmount:
        "$tieredReduction.formattedDetails.priceReductionTierAmount"
    }
  }
]

Hi @Rushikesh_Gandhmal -

Unfortunately you can’t directly control the order that the series display on the chart. For string values they always show in alphabetical order. Your best bet is to use $cond to rewrite the value you want at the bottom to have a label that sorts after all the other values.

Tom