More
This commit is contained in:
parent
cd34ee693f
commit
05a1f316e1
58 changed files with 3113 additions and 1277 deletions
|
|
@ -13,9 +13,7 @@ export default function EnumBarChart({
|
|||
const localTotal = entries.reduce((sum, [, c]) => sum + c, 0);
|
||||
|
||||
// When global counts are available, normalize both to percentages for comparison
|
||||
const globalTotal = globalCounts
|
||||
? Object.values(globalCounts).reduce((sum, c) => sum + c, 0)
|
||||
: 0;
|
||||
const globalTotal = globalCounts ? Object.values(globalCounts).reduce((sum, c) => sum + c, 0) : 0;
|
||||
|
||||
const hasGlobal = globalCounts && globalTotal > 0;
|
||||
|
||||
|
|
@ -61,9 +59,14 @@ export default function EnumBarChart({
|
|||
)}
|
||||
<div
|
||||
className={
|
||||
barStyle ? 'h-full rounded relative' : 'h-full bg-teal-500 dark:bg-teal-400 rounded relative'
|
||||
barStyle
|
||||
? 'h-full rounded relative'
|
||||
: 'h-full bg-teal-500 dark:bg-teal-400 rounded relative'
|
||||
}
|
||||
style={{ width: `${localWidth}%`, ...(barStyle ? { backgroundColor: barStyle } : {}) }}
|
||||
style={{
|
||||
width: `${localWidth}%`,
|
||||
...(barStyle ? { backgroundColor: barStyle } : {}),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="w-8 text-warm-500 dark:text-warm-400 text-right shrink-0">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue