histogram width divide by mode, not total #2
1 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,8 @@ type Props = {
|
|||
}
|
||||
|
||||
export const Histogram = ({ gameStats }: Props) => {
|
||||
const { totalGames, winDistribution } = gameStats
|
||||
const winDistribution = gameStats.winDistribution
|
||||
const maxValue = Math.max(...winDistribution)
|
||||
|
||||
return (
|
||||
<div className="columns-1 justify-left m-2 text-sm">
|
||||
|
@ -14,7 +15,7 @@ export const Histogram = ({ gameStats }: Props) => {
|
|||
<Progress
|
||||
key={i}
|
||||
index={i}
|
||||
size={95 * (value / Math.max(...winDistribution))}
|
||||
size={90 * (value / maxValue)}
|
||||
label={String(value)}
|
||||
/>
|
||||
))}
|
||||
|
|
Loading…
Add table
Reference in a new issue