Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
feat: added statistics for the typing test
Browse files Browse the repository at this point in the history
  • Loading branch information
vycdev committed Apr 16, 2020
1 parent 6473ebd commit 7d20a93
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/web/src/components/common/typingBox/dataBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useState, useEffect, useRef } from "react";
import { LineChart, XAxis, YAxis, Line, Tooltip, Legend } from "recharts";
import { DataBoxWrapper } from "./style";

import { DataBoxType } from "./helpers/interfaces";

export const DataBox = (props: React.Component<DataBoxType, {}>) => {
return (
<DataBoxWrapper>
<LineChart
width={725}
height={300}
data={props.data}
margin={{ top: 30, bottom: 5 }}
>
<Line
name="WPM"
type="monotone"
dataKey="wpm"
stroke="#198cf6"
dot={<></>}
/>
<Line
name="Accuracy"
type="monotone"
dataKey="accuracy"
stroke="black"
dot={<></>}
/>

<XAxis dataKey="timeUsed" />
<YAxis />
<Tooltip />
<Legend />
</LineChart>
</DataBoxWrapper>
);
};

0 comments on commit 7d20a93

Please sign in to comment.