Skip to content

Commit

Permalink
make user growth chart use steps instead of curve since that doesnt r…
Browse files Browse the repository at this point in the history
…eally make sense

Signed-off-by: 3nt3 <gott@3nt3.de>
  • Loading branch information
3nt3 committed Feb 25, 2022
1 parent ad97a9f commit aa864b1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/pages/AdminDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,16 @@ function UserGrowthChart(props: { users: User[]; requestState: RequestState }) {
data={[
{
id: "growth_graph",
data: props.users.reduce(
(previousValue: any[], user: User) => [
...previousValue,
{ x: user.createdAt, y: previousValue.length + 1 },
],
[]
),
data: [
...props.users.reduce(
(previousValue: any[], user: User) => [
...previousValue,
{ x: user.createdAt, y: previousValue.length + 1 },
],
[]
),
{ x: new Date(), y: props.users.length },
],
},
]}
enablePointLabel={false}
Expand Down Expand Up @@ -243,7 +246,7 @@ function UserGrowthChart(props: { users: User[]; requestState: RequestState }) {
fontSize: 14,
crosshair: { line: { stroke: "var(--text_color)" } },
}}
curve="monotoneX"
curve="step"
sliceTooltip={({ slice }) => {
return (
<div id={css.tooltip}>
Expand Down

0 comments on commit aa864b1

Please sign in to comment.