From 1c67fd5c436261d1b5c64173205f5bed47d3bf3d Mon Sep 17 00:00:00 2001 From: Luna McNulty Date: Tue, 25 Jul 2023 13:04:05 +0200 Subject: [PATCH] Fix Autonomy order --- site/gatsby-site/src/pages/summaries/cset-charts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/site/gatsby-site/src/pages/summaries/cset-charts.js b/site/gatsby-site/src/pages/summaries/cset-charts.js index c62dad4d77..2771204b3c 100644 --- a/site/gatsby-site/src/pages/summaries/cset-charts.js +++ b/site/gatsby-site/src/pages/summaries/cset-charts.js @@ -196,10 +196,11 @@ function GroupBarChart({ groups, attributeShortName, classifications, namespace, const groupNames = Object.keys(groups); + const autonomySort = (a, b) => Number(a.id[8] || 0) - Number(b.id[8] || 0); + const options = { data: { - order: - attributeShortName == 'Autonomy Level' ? (a, b) => Number(a[8]) - Number(b[8]) : undefined, + order: attributeShortName == 'Autonomy Level' ? autonomySort : undefined, x: 'x', columns: [ ['x', ...groupNames],