mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Fix percentages.
This commit is contained in:
parent
60e7257656
commit
4d66d400a9
2 changed files with 7 additions and 4 deletions
|
|
@ -33,10 +33,13 @@ export function GoalsChart({ className }: { className?: string; isLoading?: bool
|
|||
<span className={styles.visitors}>{formatLongNumber(goal)}</span>
|
||||
{formatMessage(labels.goal)}
|
||||
</div>
|
||||
<div className={styles.percent}>{(result / goal).toFixed(2)}%</div>
|
||||
<div className={styles.percent}>{((result / goal) * 100).toFixed(2)}%</div>
|
||||
</div>
|
||||
<div className={styles.track}>
|
||||
<div className={styles.bar} style={{ width: `${result / goal}%` }}></div>
|
||||
<div
|
||||
className={styles.bar}
|
||||
style={{ width: `${result > goal ? 100 : (result / goal) * 100}%` }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ async function clickhouseQuery(
|
|||
const results = a[0];
|
||||
|
||||
return Object.keys(results).map((key, i) => {
|
||||
return { ...urls[i], result: results[key] };
|
||||
return { ...urls[i], goal: Number(urls[i].goal), result: Number(results[key]) };
|
||||
});
|
||||
})
|
||||
: [];
|
||||
|
|
@ -216,7 +216,7 @@ async function clickhouseQuery(
|
|||
const results = a[0];
|
||||
|
||||
return Object.keys(results).map((key, i) => {
|
||||
return { ...events[i], result: results[key] };
|
||||
return { ...events[i], goal: Number(events[i].goal), result: Number(results[key]) };
|
||||
});
|
||||
})
|
||||
: [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue