🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Use the total event count to calculate the percentage of each event type (#490)
Chris Rimmere109a697fa95
diff --git a/client/src/app/[site]/events/components/EventList.tsx b/client/src/app/[site]/events/components/EventList.tsxindex d85c5c0ea..df10b9387 100644--- a/client/src/app/[site]/events/components/EventList.tsx+++ b/client/src/app/[site]/events/components/EventList.tsx@@ -133,13 +133,13 @@ export function EventList({);}- // Find the highest count to calculate percentages- const maxCount = Math.max(...events.map((event) => event.count));+ // Find the total count to calculate percentages+ const totalCount = events.reduce((sum, event) => sum + event.count, 0);return (<div className="flex flex-col gap-2">{events.map((event) => {- const percentage = (event.count / maxCount) * 100;+ const percentage = (event.count / totalCount) * 100;const isExpanded = expandedEvent === event.eventName;return (