making bar charts horizontal

This commit is contained in:
frankknoll
2023-01-29 01:10:44 +01:00
parent c352114764
commit e72d86b66a
3 changed files with 188 additions and 42 deletions

View File

@@ -6,4 +6,14 @@ class Utils {
const nums = [...arr].sort((a, b) => a - b);
return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
}
static getKeysAlignedWithValues(dict) {
const keys = [];
const values = [];
for (const [key, value] of Object.entries(dict)) {
keys.push(key);
values.push(value);
}
return { 'keys': keys, 'values': values };
}
}