Fixed attribution report. New metric cards. Converted ListTable.
This commit is contained in:
@@ -47,6 +47,7 @@ export const emptyFilter = (data: any[]) => {
|
||||
};
|
||||
|
||||
export const percentFilter = (data: any[]) => {
|
||||
if (!data) return [];
|
||||
const total = data.reduce((n, { y }) => n + y, 0);
|
||||
return data.map(({ x, y, ...props }) => ({ x, y, z: total ? (y / total) * 100 : 0, ...props }));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user