making bar charts horizontal
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user