Learn pattern to change data on the same chart. For example, change data from Union to Confederate.
- selectAll( thing to draw such as circle )
d3.csv('data/rainfall-by-state.csv').then(data => { | |
data.forEach(stateData => { | |
stateData.rainfall = +stateData.rainfall; | |
const checkChar = /^[A-Z]/; | |
for (let i = 0; i < 5; i++) { | |
if (checkChar.test(stateData.state)) { | |
console.log('found capital letter'); | |
break; | |
} else { | |
stateData.state = stateData.state.substring(1); |
Continuation of data join lesson for Civil War
https://gist.github.com/codetricity/3f4958488fdf87b912988bfa77384661
https://bl.ocks.org/codetricity/b952c44f308e39b526eb9b9d7ab4f147
Files for the demo are included in this gist.
https://kprofiles.com/bts-bangtan-boys-members-profile/
total attendance with tooltip for countries