I'm working on development of a universal report with simple market overview, where you can explain sales change over time in various ways. I built a stacked bar chart which shows:
-a chosen KPI value (on Y axis there's a parameter with all the possible measures with KPIs collected in one place)
-for Top N best products (products are put in the legend, top N is selected dynamically based on N input)
-over time (there are month/week numbers on the X axis).
What I got so far is such bar chart:
Bar chart without satisfying sorting
which, as you all can see, is not sorted in the same order as products in my top N - the bar sorting is different for each bar and I'd love it to be the same for all of them. For example, I have top 4 based on KPI called Total Sales Value in February 2025 - Product 1 sold 10$, Product 2 sold 8$, Product 3 sold 6$ and Product 4 sold 4$ in this February. So the order (down to up) in the last bar is going to be:
Product |
---|
1 |
2 |
3 |
4 |