fix: sorting order
This commit is contained in:
parent
3ec3c873ff
commit
9973c25054
|
@ -57,7 +57,7 @@ const getVictoryGroup = ({ data, i }: { data: DataSet; i: number }) => {
|
||||||
|
|
||||||
export const HistoryChart: React.FC<Props> = ({ question }) => {
|
export const HistoryChart: React.FC<Props> = ({ question }) => {
|
||||||
let dataSetsNames = question.options
|
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);
|
.map((o) => o.name);
|
||||||
dataSetsNames = [...new Set(dataSetsNames)].slice(0, 5); // take the first 5
|
dataSetsNames = [...new Set(dataSetsNames)].slice(0, 5); // take the first 5
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user