Skip to content

Commit

Permalink
feat: refine xg diff chart
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmontgomery committed May 28, 2024
1 parent 8e4ef43 commit dc32907
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pages/[league]/xg/rolling/[stat]/[period].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export default function Chart(): React.ReactElement {
}
return (
<BaseASARollingPage
getBackgroundColor={(value) =>
(value ?? 0) > 0 ? "success.main" : "error.main"
}
renderControls={renderComponent}
endpoint={(year, league) => `/api/asa/xg?year=${year}&league=${league}`}
isStaticHeight={false}
Expand Down Expand Up @@ -173,10 +176,10 @@ function dataParser({
typeof statHeightCalc[stat] === "function"
? statHeightCalc[stat]
: (value, periodLength) =>
`${
`${Math.abs(
((value || 0) / (periodLength * statHeightMap[stat])) *
100
}%`
100,
)}%`
}
/>
);
Expand Down

0 comments on commit dc32907

Please sign in to comment.