generated from uclaacm/teach-la-react-starter-barebones
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
website/src/components/posts/CollegeAdmissions/enrollmentGraph/WomenEnrollmentContainer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import { | ||
LineChart, | ||
Line, | ||
Label, | ||
XAxis, | ||
YAxis, | ||
CartesianGrid, | ||
Tooltip, | ||
ResponsiveContainer, | ||
} from "recharts"; | ||
import data from "./enrollmentData.js"; | ||
|
||
export default function WomenEnrollmentContainer() { | ||
return ( | ||
<ResponsiveContainer width="100%" height={400}> | ||
<LineChart | ||
width={500} | ||
height={300} | ||
data={data} | ||
margin={{ | ||
top: 5, | ||
right: 30, | ||
left: 20, | ||
bottom: 5, | ||
}} | ||
> | ||
<CartesianGrid strokeDasharray="3 3" /> | ||
<XAxis dataKey="name" dy={2} fontSize="1.1rem" /> | ||
<YAxis fontSize="1.1rem" unit="" orientation="right"> | ||
<Label value="Women Enrolled" angle={90} position="right" /> | ||
</YAxis> | ||
<Tooltip /> | ||
<Line | ||
type="monotone" | ||
dataKey="women enrolled" | ||
stroke="#d1001f" | ||
activeDot={{ r: 8 }} | ||
unit="" | ||
/> | ||
</LineChart> | ||
</ResponsiveContainer> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
website/src/components/posts/CollegeAdmissions/enrollmentGraph/enrollmentData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const numbers = [ | ||
195, 247, 279, 248, 342, 369, 409, 360, 406, 395, 461, 431, 426, 455, 469, | ||
472, 497, | ||
]; | ||
let year = 1988; | ||
const data = numbers.map((m) => { | ||
year += 2; | ||
return { | ||
name: year, | ||
"women enrolled": m, | ||
}; | ||
}); | ||
|
||
export default data; |