fix(dashboard,api): show correct percentage on retention
This commit is contained in:
@@ -36,11 +36,12 @@ export function Chart({ data }: Props) {
|
||||
tickFormatter: (value) => `${value}%`,
|
||||
});
|
||||
const averageRow = data[0];
|
||||
const averageRetentionRate = average(averageRow?.percentages || [], true);
|
||||
const rechartData = averageRow?.percentages.map((item, index, list) => ({
|
||||
const averageRetentionRate =
|
||||
average(averageRow?.percentages || [], true) * 100;
|
||||
const rechartData = averageRow?.percentages.map((item, index) => ({
|
||||
days: index,
|
||||
percentage: item,
|
||||
value: averageRow.values[index],
|
||||
percentage: item * 100,
|
||||
value: averageRow.values?.[index],
|
||||
sum: averageRow.sum,
|
||||
}));
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export function RetentionTooltip({ active, payload }: Props) {
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Retention Rate:</span>
|
||||
<span className="font-medium">
|
||||
{number.formatWithUnit(percentage, '%')}
|
||||
{number.formatWithUnit(percentage / 100, '%')}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
|
||||
Reference in New Issue
Block a user