From 9973c250543aa2f3b9c86e4c8d190357198a96ad Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 4 May 2022 02:03:57 +0400 Subject: [PATCH] fix: sorting order --- src/web/questions/components/HistoryChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/questions/components/HistoryChart.tsx b/src/web/questions/components/HistoryChart.tsx index 4623ce9..bde92e9 100644 --- a/src/web/questions/components/HistoryChart.tsx +++ b/src/web/questions/components/HistoryChart.tsx @@ -57,7 +57,7 @@ const getVictoryGroup = ({ data, i }: { data: DataSet; i: number }) => { export const HistoryChart: React.FC = ({ question }) => { let dataSetsNames = question.options - .sort((a, b) => (a.probability < b.probability ? -1 : 1)) + .sort((a, b) => (a.probability > b.probability ? -1 : 1)) .map((o) => o.name); dataSetsNames = [...new Set(dataSetsNames)].slice(0, 5); // take the first 5