-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbyrace.js
41 lines (40 loc) · 1.25 KB
/
byrace.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var byrace = d3plus.viz().container("#byrace");
d3.csv("data/byrace.csv", function(error, temp) {
if (error) return console.error(error);
temp.forEach(function(d) {
d3.keys(d).forEach(function(k) {
if (k == "Percent") {
d[k] = +d[k]
}
})
})
byrace
.data(temp)
.type("bar")
.id("Race")
.x({ 'value': 'Period', 'label': { 'font': { 'size': 16 } } })
.y({ 'value': "Percent", 'range': [0, 100] })
.time({ "value": "Year", "solo": 2016, 'fixed': true })
.color({ 'value': 'color' })
.font({
"size": 14,
"family": "Raleway, sans-serif"
})
.title("Percent of All Graduates Employed in Ohio: By Race")
.title({
"sub": "Within six months and within one year after graduation.",
"total": false
})
.title({
"font": {
"family": "Montserrat, sans-serif",
"size": 16,
"transform": "uppercase"
}
})
.tooltip({ "font": { "family": "Raleway, sans-serif" } })
.tooltip(['value', 'Year'])
.order({ "value": "Period" })
.text("Undergraduate")
.draw()
})